Search code examples
mavenbuild-processmaven-3maven-assembly-plugin

How to instruct Maven 3.0.3 to extract only common jar file into newly generated artifact?


I'm using Maven 3.0.3 and trying to achieve the following:

project-a (this is my parent POM)-->assembly pom-->dev/test/qa/prod POMs which generating zip files (one per environment). I do have quite a few "common" property files and xml files that I'd like to put into common zip file and "embed" or "extract" into dev/test/qa/prod zip files. I was trying to avoid putting these common components into assembly pom and then reach to them by using relative path (i.e. something like "../common") and instead create a POM that would be dependent from dev/test/qa/prod POMs... How can I instruct those POMs to extract ONLY one zip or jar file that is project-common.jar!!!


Solution

  • Possible the maven-dependency-plugin can help to extract your artifact: http://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html