I'm trying to setup my maven build to copy all the build artifacts and other generated files to a central directory for distribution. After reading docs, the assembly plugin and the dependency plugin seem to be the ones to use. but I cant get them to play well together.
first - If I follow the directions here and add this to my top level pom:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-installed</id>
<phase>install</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<type>${project.packaging}</type>
</artifactItem>
</artifactItems>
<outputDirectory>${ReleaseFolder}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
all seems fine until I run a clean followed by an install - then maven complains it cant find my top level pom to install. which seems counter-intuitive... i wont want the "pom" files to be copied, i want the module artifacts. How do I exclude them?
And related to this - is there a way to add custom types or tags of some kind to projects so i can have the dependancy copy work one way on one type of sub-project and a diferent way on another type?
new to maven -- so please be gentle.
edit:
My project structure looks something like so:
/pom.xml (top level pom)
Common_data
ComponentA
ComponentB
ComponentC
ComponentT (depends on A, B and C)
J2ee_A
j2ee_A_ear (depends on war)
j2ee_A_rar
j2ee_A_war
J2ee_B
j2ee_B_ear (depends on war)
j2ee_B_rar
j2ee_B_war
j2ee_B_jar (depends on ComponentB)
and then ${ReleaseFolder} points to /Release at the same level as the top level pom.
Follow-up: So what im hearing is dependency:copy is not the route to go, but using an assembly is.
How do I get an assembly to operate on many different modules and then copy the resulting files to a single output directory?
To add to things - there are 2 general types of components, a jar component (makes a single jar file), and a j2ee component which produces, ear, war, jar, rar and config files.
If there was a way to assign my own tags to a project and then run an assembly based on that tag value, I can see that working. But I havent found anything in the documentation on how to trigger or skip an assembly based on user defined properties in a sub-project.
Ideas anyone?