assembly is not working as needed



git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/jci/trunk@546428 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/assembly/pom.xml b/assembly/pom.xml
deleted file mode 100644
index d765bff..0000000
--- a/assembly/pom.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
---><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.commons</groupId>
-        <artifactId>commons-jci</artifactId>
-        <version>1.0-SNAPSHOT</version>
-    </parent>
-    <packaging>pom</packaging>
-    <artifactId>commons-jci-assemblies</artifactId>
-    <version>1.0-SNAPSHOT</version>
-    <name>assemblies</name>
-    <description>
-        Commons JCI assemblies.
-    </description>
-    <reporting>
-        <excludeDefaults>true</excludeDefaults>
-    </reporting>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-jci-core</artifactId>
-            <version>1.0-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-jci-eclipse</artifactId>
-            <version>1.0-SNAPSHOT</version>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <configuration>
-                    <finalName>commons-jci-${project.version}</finalName>
-                    <descriptors>
-                        <descriptor>src/assembly/bin.xml</descriptor>
-                        <descriptor>src/assembly/src.xml</descriptor>
-                    </descriptors>
-                    <tarLongFileMode>gnu</tarLongFileMode>
-                </configuration>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>attached</goal>
-                        </goals>
-                    </execution>
-                </executions>                
-            </plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/assembly/src/assembly/bin.xml b/assembly/src/assembly/bin.xml
deleted file mode 100644
index 10fb3bd..0000000
--- a/assembly/src/assembly/bin.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<assembly>
-    <id>bin</id>
-    <formats>
-        <format>tar.gz</format>
-        <format>zip</format>
-    </formats>
-    <baseDirectory>commons-jci-${project.version}-bin</baseDirectory>
-    <includeSiteDirectory>false</includeSiteDirectory>
-
-<!--
-    <moduleSets>
-        <moduleSet>
-            <includes>
-                <include>org.apache.commons:commons-jci-core</include>
-            </includes>
-            <binaries>
-                <outputDirectory>lib/${artifactId}</outputDirectory>
-                <unpack>false</unpack>
-            </binaries>
-        </moduleSet>
-    </moduleSets>
--->
-    <fileSets>
-        <fileSet>
-            <includes>
-                <include>../LICENSE.txt</include>
-                <include>../NOTICE.txt</include>
-                <include>../README.txt</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>../target/site/apidocs</directory>
-            <outputDirectory>apidocs</outputDirectory>
-        </fileSet>
-        <fileSet>
-            <outputDirectory>lib</outputDirectory>
-            <directory>../core/target</directory>
-            <includes>
-                <include>*.jar</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <outputDirectory>lib</outputDirectory>
-            <directory>../fam/target</directory>
-            <includes>
-                <include>*.jar</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <outputDirectory>lib</outputDirectory>
-            <directory>../compilers/eclipse/target</directory>
-            <includes>
-                <include>*.jar</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <outputDirectory>lib</outputDirectory>
-            <directory>../compilers/groovy/target</directory>
-            <includes>
-                <include>*.jar</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <outputDirectory>lib</outputDirectory>
-            <directory>../compilers/janino/target</directory>
-            <includes>
-                <include>*.jar</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <outputDirectory>lib</outputDirectory>
-            <directory>../compilers/javac/target</directory>
-            <includes>
-                <include>*.jar</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <outputDirectory>lib</outputDirectory>
-            <directory>../compilers/rhino/target</directory>
-            <includes>
-                <include>*.jar</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <outputDirectory>lib</outputDirectory>
-            <directory>../examples/target</directory>
-            <includes>
-                <include>*.jar</include>
-            </includes>
-        </fileSet>
-    </fileSets>
-</assembly>
diff --git a/assembly/src/assembly/src.xml b/assembly/src/assembly/src.xml
deleted file mode 100644
index f60eb5a..0000000
--- a/assembly/src/assembly/src.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<assembly>
-    <id>src</id>
-    <formats>
-        <format>tar.gz</format>
-        <format>zip</format>
-    </formats>
-    <baseDirectory>commons-jci-${project.version}-src</baseDirectory>
-    <fileSets>
-        <fileSet>
-            <includes>
-                <include>../LICENSE.txt</include>
-                <include>../NOTICE.txt</include>
-                <include>../README.txt</include>
-                <include>../pom.xml</include>
-                <include>../core/pom.xml</include>
-                <include>../fam/pom.xml</include>
-                <include>../compilers/eclipse/pom.xml</include>
-                <include>../compilers/groovy/pom.xml</include>
-                <include>../compilers/janino/pom.xml</include>
-                <include>../compilers/javac/pom.xml</include>
-                <include>../compilers/rhino/pom.xml</include>
-                <include>../exmaples/pom.xml</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>../src</directory>
-        </fileSet>
-        <fileSet>
-            <directory>../core/src</directory>
-        </fileSet>
-        <fileSet>
-            <directory>../fam/src</directory>
-        </fileSet>
-        <fileSet>
-            <directory>../compilers/eclipse/src</directory>
-        </fileSet>
-        <fileSet>
-            <directory>../compilers/groovy/src</directory>
-        </fileSet>
-        <fileSet>
-            <directory>../compilers/janino/src</directory>
-        </fileSet>
-        <fileSet>
-            <directory>../compilers/javac/src</directory>
-        </fileSet>
-        <fileSet>
-            <directory>../compilers/rhino/src</directory>
-        </fileSet>
-        <fileSet>
-            <directory>../examples/src</directory>
-        </fileSet>
-    </fileSets>
-</assembly>
diff --git a/build-dists.sh b/build-dists.sh
index b31d20d..6ba25d5 100755
--- a/build-dists.sh
+++ b/build-dists.sh
@@ -1,46 +1,64 @@
 #!/bin/sh
 
-TMP="`pwd`/target"
-DIST="$TMP/dist"
-LIB="$DIST/lib"
+set -e
 
-find $TMP -name *.zip -delete
-find $TMP -name *.tar.gz -delete
-rm -R $DIST 2>/dev/null
+BASE=`pwd`
 
+RC=`xml sel -N m=http://maven.apache.org/POM/4.0.0 -t -v '/m:project/m:properties/m:release.tag' $BASE/pom.xml`
+STAGING=`xml sel -N m=http://maven.apache.org/POM/4.0.0 -t -v "/m:project/m:profiles/m:profile[m:id/text() = 'release']/m:distributionManagement/m:repository/m:url" $BASE/pom.xml | sed "s/\\${commons.deployment.protocol}:\/\//$USER@/" | sed "s/\\${release.tag}/$RC/" | sed 's#/#:/#'`
+RELEASE=`echo $RC|sed s/-.*//`
 
-# build source dist
+echo "creating $RELEASE from $RC at $STAGING"
 
-tar czvf $TMP/commons-jci-1.0-src.tar.gz --exclude .svn --exclude target --exclude dist.sh .
-zip -r $TMP/commons-jci-1.0-src.zip . -x "*.svn/*" -x "target/*"
+MAVEN_RELEASE="$BASE/target/maven-dist"
+DIST="$BASE/target/dist"
 
+rm -R $MAVEN_RELEASE 2>/dev/null || true
+rm -R $DIST 2>/dev/null || true
+
+scp -r $STAGING $MAVEN_RELEASE
 
 
 # build binary dist
 
+LIB="$DIST/bin/lib"
 mkdir -p $LIB 2>/dev/null
 
-JARS=`find target -type f -name "*-1.0.jar"`
+JARS=`find $MAVEN_RELEASE -type f -name "*-$RELEASE.jar"`
 
 for A in $JARS ; do
     cp $A $LIB
 done
 
-cp LICENSE.txt NOTICE.txt $DIST
+cp $BASE/LICENSE.txt $BASE/NOTICE.txt $DIST/bin
 
+cd $DIST/bin
 
+tar czvf $BASE/target/commons-jci-$RELEASE-bin.tar.gz .
+zip -r $BASE/target/commons-jci-$RELEASE-bin.zip .
 
-cd $DIST
-
-tar czvf $TMP/commons-jci-1.0-bin.tar.gz .
-zip -r $TMP/commons-jci-1.0-bin.zip .
+cd -
 
 
 
 
+# build source dist
 
-ARTIFACTS="$TMP/commons-jci-1.0-bin.tar.gz $TMP/commons-jci-1.0-bin.zip $TMP/commons-jci-1.0-src.tar.gz $TMP/commons-jci-1.0-src.zip"
+SOURCE=`xml sel -N m=http://maven.apache.org/POM/4.0.0 -t -v "/m:project/m:scm/m:developerConnection" $BASE/pom.xml | sed 's/scn:svn://' | sed "s/trunk/tags\/$RC/"`
 
+mkdir -p $DIST/src 2>/dev/null
+cd $DIST/src
+
+svn co $SOURCE .
+
+
+tar czvf $BASE/target/commons-jci-$RELEASE-src.tar.gz --exclude .svn --exclude target --exclude dist.sh .
+zip -r $BASE/target/commons-jci-$RELEASE-src.zip . -x "*.svn/*" -x "target/*"
+
+
+# sign
+
+ARTIFACTS="`find $BASE/target -name *.zip -maxdepth 1` `find $BASE/target -name *.tar.gz -maxdepth 1`"
 
 RUNNING=`ps -ax | grep gpg-agent | grep -v grep`
 if [ -z "$RUNNING" ]; then
@@ -58,8 +76,7 @@
   openssl sha1 < $A > $A.sha1
 done
 
-
-for A in $TGZS $ZIPS ; do
+for A in $ARTIFACTS ; do
   echo $A
   gpg --verify $A.asc $A
 done
diff --git a/pom.xml b/pom.xml
index 8a1067f..180b373 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,7 +47,6 @@
         <module>compilers/javac</module>
         <module>compilers/rhino</module>
         <module>examples</module>
-        <module>assembly</module>
     </modules>
     <distributionManagement>
         <site>