Maven - Using the Assembly plugin to package dependencies from multiple projects into one file -
i’m working on project made of multiple other projects. has next structure:
mainproject --projecta --projectb --projectc --projectd --parent --projecte ... --projectx
as can see parent amongst others. i’m not sure if unusual or not way , have work it.
i’m looking utilize assembly plugin dependencies each of sub projects , zip them within 1 folder. example, want zip file containing folder contains of unpacked dependencies of children projects.
this have far:
assembly.xml (this in parent project)
[...] <id>package</id> <formats> <format>zip</format> </formats> <includebasedirectory>false</includebasedirectory> <modulesets> <moduleset> <includes> <include>com.example:../one</include> <include>com.example2:../two</include> <include>com.examplex:../three</include> </includes> <binaries> <outputdirectory>/library/jars</outputdirectory> <unpack>false</unpack> </binaries> </moduleset> </modulesets> <dependencysets> <dependencyset> <unpack>false</unpack> <scope>runtime</scope> <outputdirectory>library/jars</outputdirectory> </dependencyset> </dependencysets> <filesets> <fileset> <excludes> <exclude>**.xml</exclude> </excludes> </fileset> </filesets> </assembly>
and in parent pom.xml
[...] <plugin> <artifactid>maven-assembly-plugin</artifactid> <version>2.4</version> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>assembly</goal> </goals> </execution> </executions> <configuration> <descriptors> <descriptor>assembly.xml</descriptor> </descriptors> </configuration> </plugin> [...]
when run mvn clean install
cmd build successful. not create zip file containing library/jars
directory should contain of dependencies each of projects. creates zips in each project. these zips not contain directory want or dependencies, zips of each project directory. can see doing wrong?
maven dependencies maven-assembly-plugin multi-module
No comments:
Post a Comment