I am working on moving a project from Ant to Maven. The final distribution I need to deliver is a zip containing an executable jar with all its dependencies. Here is part of my pom:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.2-beta-4</version> <configuration> <finalName>ProjectDistribution</finalName> <appendAssemblyId>false</appendAssemblyId> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <mainClass>fullQualifiedNameToMainClass</mainClass> <addClasspath>true</addClasspath> </manifest> </archive> <descriptors> <descriptor>${project.basedir}/src/main/assembly/dep.xml</descriptor> </descriptors> </configuration> <executions> <execution> <id>jar-with-dependencies</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> <execution> <id>dist</id> <phase>assembly</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin>
And here is the build file:
<assembly> <id>dist</id> <formats> <format>zip</format> </formats> <fileSets> <fileSet> <directory>/HelpFiles</directory> <outputDirectory></outputDirectory> <includes> <include>*.*</include> </includes> </fileSet> </fileSets>
I start compiling 1.mvn, 2.-mvn and build 3.-mvn: single
The problem I'm dealing with is that
It generates a jar with all the dependencies, and it generates a zip, but does not include the jar in zip. I really need to figure out a way to create an assembly, first create a jar and wait until it is created (because its size is 5 MB), and then create a zip. Right now, the 1st and 2nd approaches - from the build file - are commented out, however I used both, and none of them seem to work.
Any help would be greatly appreciated!
Eric
source share