Maven Users:
I have been searching for examples of how to make this work, but I must be
missing something.
We have a multimodule project, along these lines:
proj-parent
|- modules
|- module1
|- target
|- module1-1.0.0-classifiername.jar
|- module2
|- WebRoot
|- XXX
module1's output is two jar files, one the standard output, and the other the
extra one defined with includes/excludes using the maven-jar-plugin and a
classifier.
What I want to do is include this attachment inside the module2 war artifact,
under that XXX folder. The WebRoot folder is defined to be the staging area for
the war artifact.
I have tried to use an assembly to do this, but it has no effect. The modules
project defines this in its build plugins:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/assemble/classifiername.xml</descriptor>
</descriptors>
</configuration>
</plugin>
I put the classifiername.xml under the modules project in the src/assemble
folder, and it contains:
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0
http://maven.apache.org/xsd/assembly-1.1.0.xsd<http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0%20http:/maven.apache.org/xsd/assembly-1.1.0.xsd>">
<moduleSets>
<moduleSet>
<includes>
<include>*:module1</include>
</includes>
<binaries>
<attachmentClassifier>classifiername</attachmentClassifier>
<outputDirectory>module2/WebRoot/XXX</outputDirectory>
<outputFileNameMapping>foo.jar</outputFileNameMapping>
</binaries>
</moduleSet>
</moduleSets>
</assembly>
But, when I run mvn clean install, the war file does not contain the file, and
the build output never mentions it even tried to follow the instructions, no
errors either. How do I get this to work?
This artifact is a special jar that gets deployed to clients via the web using
Java Web Start, and this is a port of an existing project, so I cannot change
the internal folder layout of the war.
(Names of the artifacts and projects have been changed to protect the innocent.)
Tom Harris
P.S. This was posted on Monday 3/1, but nobody responded at all, and our team
really needs to move on this. Please help.