maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adkins, Michael J." <MICHAEL.J.ADK...@saic.com>
Subject RE: Install project with dependencies
Date Wed, 01 Sep 2010 20:51:10 GMT
Actually Marcelo, what you want is fairly simple. Use either
appassembler:assemble (which autopackages everything and includes a .bat
to run it with), or if you want more control, use
dependencies:copy-dependencies to copy the dependencies to the location
of your choice. You could then use dependencies:copy to copy the main
jar file to the location of your choice. 

Granted that's likely not the most efficient way to do it but it works
for me and my uses.

Example of the dependency copy:
<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-dependency-plugin</artifactId>
   <executions>
      <execution>
         <id>install-copydependencies</id>
         <phase>install</phase>
         <goals>
            <goal>copy-dependencies</goal>
         </goals>
         <configuration>
 
<outputDirectory>${project.build.directory}/${project.build.finalName}/l
ib</outputDirectory>
         </configuration>
      </execution>
   </executions>
</plugin>

If you wanted to get bonus points and the chance for a one-up, try using
assembly:single with the descriptorRef set to "project" and point the
archiveBaseDirectory to the directory the main jar and the dependencies
are in (in this case:
"${project.build.directory}/${project.build.finalName") to produce 3
archived versions of it.

Links of varying degrees of importance:
http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencie
s-mojo.html
http://maven.apache.org/plugins/maven-dependency-plugin/copy-mojo.html
http://maven.apache.org/plugins/maven-assembly-plugin/plugin-info.html
http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/

-Michael J.

========================================================================
========================

Assembly and Shade putz all the source code into the jar file. 

Is there a way to have maven create a jar file and point to the
/.m2/repository for the dependencies ??
-- 
View this message in context:
http://maven.40175.n5.nabble.com/Install-project-with-dependencies-tp279
8374p2798583.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message