From: <sta...@us...> - 2007-03-16 06:12:51
|
Revision: 1585 http://archive-access.svn.sourceforge.net/archive-access/?rev=1585&view=rev Author: stack-sf Date: 2007-03-15 23:12:50 -0700 (Thu, 15 Mar 2007) Log Message: ----------- * src/main/assembly/src-distribution.xml * src/main/assembly/bin-distribution.xml Removed. * src/main/assembly/distribution.xml Added in place of above two assemblies. * nutchwax-war/src/main/assembly/placeholder.xml * nutchwax-job/src/main/assembly/placeholder.xml A do near-nothing assembly whose product gets overwritten (see comment at head of nutchwax-job pom.xml). * nutchwax-war/pom.xml Added. * pom.xml Added two modules, one for job jar and one for war. Added a dependency management. * build.xml Renamed the outputs to nutchwax-job.jar from nutchwax.jar and nutchwax-webapp.war from nutchwax.war. The old names were better but m2 won't let me have names like this in repository (All artifactids must be unique). * nutchwax-job/pom.xml Note on my hack to get nutchwax job jar and war installed into repository. * nutchwax/nutchwax-war * nutchwax/nutchwax-job Added. Modified Paths: -------------- trunk/archive-access/projects/nutchwax/build.xml trunk/archive-access/projects/nutchwax/pom.xml Added Paths: ----------- trunk/archive-access/projects/nutchwax/nutchwax-job/ trunk/archive-access/projects/nutchwax/nutchwax-job/pom.xml trunk/archive-access/projects/nutchwax/nutchwax-job/src/ trunk/archive-access/projects/nutchwax/nutchwax-job/src/main/ trunk/archive-access/projects/nutchwax/nutchwax-job/src/main/assembly/ trunk/archive-access/projects/nutchwax/nutchwax-job/src/main/assembly/placeholder.xml trunk/archive-access/projects/nutchwax/nutchwax-war/ trunk/archive-access/projects/nutchwax/nutchwax-war/pom.xml trunk/archive-access/projects/nutchwax/nutchwax-war/src/ trunk/archive-access/projects/nutchwax/nutchwax-war/src/main/ trunk/archive-access/projects/nutchwax/nutchwax-war/src/main/assembly/ trunk/archive-access/projects/nutchwax/nutchwax-war/src/main/assembly/placeholder.xml trunk/archive-access/projects/nutchwax/src/main/assembly/distribution.xml Removed Paths: ------------- trunk/archive-access/projects/nutchwax/src/main/assembly/bin-distribution.xml trunk/archive-access/projects/nutchwax/src/main/assembly/src-distribution.xml Modified: trunk/archive-access/projects/nutchwax/build.xml =================================================================== --- trunk/archive-access/projects/nutchwax/build.xml 2007-03-16 00:18:49 UTC (rev 1584) +++ trunk/archive-access/projects/nutchwax/build.xml 2007-03-16 06:12:50 UTC (rev 1585) @@ -135,7 +135,7 @@ <!-- ================================================================== --> <target name="jar" depends="compile, compile-plugins" description="Builds nutchwax jobs jar of all tasks to do import, etc." > - <zip destfile="${build.dir}/${name}${nutchwax.version}.jar"> + <zip destfile="${build.dir}/${name}-job${nutchwax.version}.jar"> <zipfileset prefix="META-INF" file="${conf.dir}/MANIFEST.MF"/> <zipfileset file="${conf.dir}/log4j.properties"/> <zipfileset file="${conf.dir}/wax-parse-plugins.xml"/> @@ -257,7 +257,7 @@ <!--Copy our nutchwax nutch-site.xml template into the build dir as nutch-site.xml. Then in the below, add it into the WEB-INF/classes dir. --> - <war destfile="${build.dir}/${name}${nutchwax.version}.war" webxml="${this.web}/web.xml"> + <war destfile="${build.dir}/${name}-webapp${nutchwax.version}.war" webxml="${this.web}/web.xml"> <fileset dir="${nutch.web}/jsp"> <exclude name="**/search.jsp"/> <exclude name="**/web.xml"/> Added: trunk/archive-access/projects/nutchwax/nutchwax-job/pom.xml =================================================================== --- trunk/archive-access/projects/nutchwax/nutchwax-job/pom.xml (rev 0) +++ trunk/archive-access/projects/nutchwax/nutchwax-job/pom.xml 2007-03-16 06:12:50 UTC (rev 1585) @@ -0,0 +1,150 @@ +<?xml version="1.0"?> +<!-- + Warning!!!! HACK Alert!!!! + + I want m2 to use the product of the old ant builds and + have m2 install the ant built nutchwax jar and war into the + maven2 repository. I do not want to rewrite and duplicate + the ant build.xml in m2 especially as its awkward with its + first needing to build nutch first. + + Maven has only a fixed set of target packages: war, jar, etc., + and a pom can only build one such target package. Its the product + of these targets that gets installed into the repository. There is + no way to have m2 substitute something other than the result of the + running of the war, jar, etc. packaging that I can see. But there + is a means of 'attach'ing something so it will get installed alongside + the pom target. + + So, to get our ant product installed into the repository, the + following was done. + + We set the packaging target for this pom to be 'pom' ('pom' is a + special target used as parent of submodules; if no submodules + 'nothing' is build but a pom file. Also, the pom target package + must be different from any assembly used or trouble). We then + used the maven-assembly-plugin and 'attach'ed an assembly to the + 'package' phase. Unfortunately, You cannot have two assemblies + in the one pom, one for assembly time and another 'attached' to + the package goal, at least not with each mention referring to + different assemblies (i.e. one building the distribution, the + other the jar or war). So, I had to make submodules of nutchwax + to hold the 'attach' assemblies, one for this job jar and another + for the war file. In each submodule, we attach the build of an + empty jar (or war over in the nutchwax-war submodule) to the + package goal below. This builds a jar named + nutchwax-job-VERSION.jar. We have also attached to the package + goal AFTER the assembly, the copying from the parent project of the + nutchwax-job-VERSION.jar down to overwrite what was written by the + just-previous 'attach' assembly. + + The overwrite makes it so the jar built by the parent gets installed + into the repository and not the one built by the assembly step. + + Ugly but it works. + + I tried making this submodule build with ant scripts but maven calls + the parent with an amended basedir, one that points into parent dir. + This makes it awkward; have to have a build.xml in both locations with + same targets. + + POM reference: http://maven.apache.org/pom.html + + List of the better articles on maven: + + http://www.javaworld.com/javaworld/jw-05-2006/jw-0529-maven.html + http://www.javaworld.com/javaworld/jw-02-2006/jw-0227-maven_p.html + + URLs on converting from 1.0 to 2.0 maven (not much good generally): + + http://wiki.osafoundation.org/bin/view/Journal/Maven2Upgrade + http://maven.apache.org/guides/mini/guide-m1-m2.html + --> +<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"> +<parent> + <groupId>org.archive</groupId> + <artifactId>nutchwax</artifactId> + <version>0.11.0-SNAPSHOT</version> +</parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.archive.nutchwax</groupId> + <artifactId>nutchwax-job</artifactId> + <packaging>pom</packaging> + <name>NutchWAX Job Jar</name> + <build> + <plugins> + <plugin> + <!-- NOTE: We don't need a groupId specification because the group is + org.apache.maven.plugins ...which is assumed by default. + --> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptors> + <descriptor> + src/main/assembly/placeholder.xml + </descriptor> + </descriptors> + <appendAssemblyId> + false + </appendAssemblyId> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>attached</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>antrun.compile</id> + <phase>compile</phase> + <configuration> + <tasks> + <!-- Make these conditional so do not run everytime--> + <echo>Compiling third.party dependencies and nutchwax</echo> + <ant dir=".." target="third.party.jar"/> + <ant dir=".." target="third.party.plugins"/> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + <execution> + <id>antrun.package</id> + <phase>package</phase> + <configuration> + <tasks> + <echo>Assembling Job JAR</echo> + <ant dir=".." target="compile"/> + <ant dir=".." target="jar"/> + <copy file="../target/nutchwax-job-${project.version}.jar" overwrite="true" + verbose="true" tofile="target/${project.artifactId}-${project.version}.jar" /> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + <execution> + <id>antrun.clean</id> + <phase>clean</phase> + <configuration> + <tasks> + <ant dir=".." target="clean-all"/> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> Added: trunk/archive-access/projects/nutchwax/nutchwax-job/src/main/assembly/placeholder.xml =================================================================== --- trunk/archive-access/projects/nutchwax/nutchwax-job/src/main/assembly/placeholder.xml (rev 0) +++ trunk/archive-access/projects/nutchwax/nutchwax-job/src/main/assembly/placeholder.xml 2007-03-16 06:12:50 UTC (rev 1585) @@ -0,0 +1,6 @@ +<assembly> + <id>placeholder</id> + <formats> + <format>jar</format> + </formats> +</assembly> Added: trunk/archive-access/projects/nutchwax/nutchwax-war/pom.xml =================================================================== --- trunk/archive-access/projects/nutchwax/nutchwax-war/pom.xml (rev 0) +++ trunk/archive-access/projects/nutchwax/nutchwax-war/pom.xml 2007-03-16 06:12:50 UTC (rev 1585) @@ -0,0 +1,84 @@ +<?xml version="1.0"?> +<!-- + POM reference: http://maven.apache.org/pom.html + + List of the better articles on maven: + + http://www.javaworld.com/javaworld/jw-05-2006/jw-0529-maven.html + http://www.javaworld.com/javaworld/jw-02-2006/jw-0227-maven_p.html + + URLs on converting from 1.0 to 2.0 maven (not much good generally): + + http://wiki.osafoundation.org/bin/view/Journal/Maven2Upgrade + http://maven.apache.org/guides/mini/guide-m1-m2.html + --> +<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"> + <parent> + <groupId>org.archive</groupId> + <artifactId>nutchwax</artifactId> + <version>0.11.0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.archive.nutchwax</groupId> + <artifactId>nutchwax-war</artifactId> + <packaging>pom</packaging> + <name>NutchWAX Webapp</name> + <build> + <plugins> + <plugin> + <!-- NOTE: We don't need a groupId specification because the group is + org.apache.maven.plugins ...which is assumed by default. + --> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptors> + <descriptor> + src/main/assembly/placeholder.xml + </descriptor> + </descriptors> + <appendAssemblyId> + false + </appendAssemblyId> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>attached</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>antrun.package</id> + <phase>package</phase> + <configuration> + <tasks> + <echo>Assembling Job JAR</echo> + <ant dir=".." target="war"/> + <copy file="../target/nutchwax-webapp-${project.version}.war" overwrite="true" + verbose="true" tofile="target/${project.artifactId}-${project.version}.war" /> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>org.archive.nutchwax</groupId> + <artifactId>nutchwax-job</artifactId> + <scope>compile</scope> + </dependency> + </dependencies> +</project> Added: trunk/archive-access/projects/nutchwax/nutchwax-war/src/main/assembly/placeholder.xml =================================================================== --- trunk/archive-access/projects/nutchwax/nutchwax-war/src/main/assembly/placeholder.xml (rev 0) +++ trunk/archive-access/projects/nutchwax/nutchwax-war/src/main/assembly/placeholder.xml 2007-03-16 06:12:50 UTC (rev 1585) @@ -0,0 +1,6 @@ +<assembly> + <id>placeholder</id> + <formats> + <format>war</format> + </formats> +</assembly> Modified: trunk/archive-access/projects/nutchwax/pom.xml =================================================================== --- trunk/archive-access/projects/nutchwax/pom.xml 2007-03-16 00:18:49 UTC (rev 1584) +++ trunk/archive-access/projects/nutchwax/pom.xml 2007-03-16 06:12:50 UTC (rev 1585) @@ -254,59 +254,10 @@ <filter>src/main/filters/filter.properties</filter> </filters> <descriptors> - <descriptor>src/main/assembly/bin-distribution.xml</descriptor> - <descriptor>src/main/assembly/src-distribution.xml</descriptor> + <descriptor>src/main/assembly/distribution.xml</descriptor> </descriptors> </configuration> </plugin> - <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>antrun.compile</id> - <phase>compile</phase> - <configuration> - <tasks> - <!-- Make these conditional so do not run everytime--> - <echo>Compiling third.party dependencies and nutchwax</echo> - <ant target="third.party.jar"/> - <ant target="third.party.plugins"/> - </tasks> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - <execution> - <id>antrun.package</id> - <phase>package</phase> - <configuration> - <tasks> - <echo>Assembling JAR and WAR targets</echo> - <ant target="compile"/> - <ant target="jar"/> - <ant target="war"/> - </tasks> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - <execution> - <id>antrun.clean</id> - <phase>clean</phase> - <configuration> - <tasks> - <echo>Cleaning nutchwax</echo> - <ant target="clean-all"/> - </tasks> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin> </plugins> </build> <reporting> @@ -396,4 +347,27 @@ <url>${website.url}/projects/${artifactId}</url> </site> </distributionManagement> + <!--Dependeny management is not same as dependencies (ugh)--> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.archive.nutchwax</groupId> + <artifactId>nutchwax-job</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.archive.nutchwax</groupId> + <artifactId>nutchwax-war</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> + </dependencyManagement> + <modules> + <module> + nutchwax-job + </module> + <module> + nutchwax-war + </module> + </modules> </project> Deleted: trunk/archive-access/projects/nutchwax/src/main/assembly/bin-distribution.xml =================================================================== --- trunk/archive-access/projects/nutchwax/src/main/assembly/bin-distribution.xml 2007-03-16 00:18:49 UTC (rev 1584) +++ trunk/archive-access/projects/nutchwax/src/main/assembly/bin-distribution.xml 2007-03-16 06:12:50 UTC (rev 1585) @@ -1,29 +0,0 @@ -<assembly> - <id>bin</id> - <formats> - <format>tar.gz</format> - <format>zip</format> - </formats> - <fileSets> - <fileSet> - <includes> - <include>*.txt</include> - </includes> - </fileSet> - <fileSet> - <directory>bin</directory> - <fileMode>0744</fileMode> - </fileSet> - <fileSet> - <directory>target</directory> - <outputDirectory /> - <includes> - <include>nutchwax*.jar</include> - <include>nutchwax*.war</include> - </includes> - </fileSet> - <fileSet> - <directory>target/docs</directory> - </fileSet> - </fileSets> -</assembly> Added: trunk/archive-access/projects/nutchwax/src/main/assembly/distribution.xml =================================================================== --- trunk/archive-access/projects/nutchwax/src/main/assembly/distribution.xml (rev 0) +++ trunk/archive-access/projects/nutchwax/src/main/assembly/distribution.xml 2007-03-16 06:12:50 UTC (rev 1585) @@ -0,0 +1,28 @@ +<assembly> + <id>distribution</id> + <formats> + <format>tar.gz</format> + </formats> + <fileSets> + <fileSet> + <includes> + <include>*.txt</include> + </includes> + </fileSet> + <fileSet> + <directory>bin</directory> + <fileMode>0744</fileMode> + </fileSet> + <fileSet> + <directory>target</directory> + <outputDirectory /> + <includes> + <include>nutchwax*.jar</include> + <include>nutchwax*.war</include> + </includes> + </fileSet> + <fileSet> + <directory>target/docs</directory> + </fileSet> + </fileSets> +</assembly> Deleted: trunk/archive-access/projects/nutchwax/src/main/assembly/src-distribution.xml =================================================================== --- trunk/archive-access/projects/nutchwax/src/main/assembly/src-distribution.xml 2007-03-16 00:18:49 UTC (rev 1584) +++ trunk/archive-access/projects/nutchwax/src/main/assembly/src-distribution.xml 2007-03-16 06:12:50 UTC (rev 1585) @@ -1,38 +0,0 @@ -<assembly> - <id>src</id> - <formats> - <format>tar.gz</format> - <format>zip</format> - </formats> - <fileSets> - <fileSet> - <includes> - <include>*.txt</include> - <include>pom.xml</include> - <include>build.xml</include> - </includes> - </fileSet> - <fileSet> - <directory>bin</directory> - <includes> - <include>**/**</include> - </includes> - <fileMode>0744</fileMode> - </fileSet> - <fileSet> - <directory>src</directory> - </fileSet> - <fileSet> - <directory>conf</directory> - </fileSet> - <fileSet> - <directory>xdocs</directory> - </fileSet> - <fileSet> - <directory>third-party</directory> - <excludes> - <exclude>**/build/**</exclude> - </excludes> - </fileSet> - </fileSets> -</assembly> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |