2

I'm looking to pull all of the dependencies from each module of my maven project and stick them into a single tar.gz file using the maven-assembly-plugin.

I currently have a pom setup as a parent to all of the modules. My idea was to use the maven-dependency-plugin to copy all of the dependencies to a single folder in the parents directory however when i use

<configuration>
    <outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>

The dependencies are copied into the modules build directory. Is there any way to set this output directory to one inside the parent project?

Tunaki
  • 132,869
  • 46
  • 340
  • 423
Carl
  • 548
  • 1
  • 4
  • 21
  • Possible duplicate of [How to use Maven assembly plugin with multi module maven project](http://stackoverflow.com/questions/24072384/how-to-use-maven-assembly-plugin-with-multi-module-maven-project) – question_maven_com Nov 20 '15 at 11:18

1 Answers1

2

You are going at it the wrong way.

Instead of creating this archive inside the parent POM, you should create another module which will be responsible for creating it. This new module will have dependencies on all the other modules.

To create the archive, you need to use the maven-assembly-plugin. I strongly suggest that you read Chapter 8. Maven Assemblies of the Maven book to get you started with using assemblies. Basically, an assembly is created with the help of an assembly descriptor. In your case, you will need to configure this descriptor to use the tar.gz format.

Tunaki
  • 132,869
  • 46
  • 340
  • 423