Dear Maven Users
I have recently converted my java command-line application to Maven. While
building an packaging the application generally works well, I still cannot
figure out a good workflow for deploying the application to a local directory
for testing purposes.
I would like to use the following directory layout in the target (i.e.
installation) directory of my application:
app_directory
+ bin/
myapp.sh (application wrapper, sets up the environment etc.)
+ lib/ (directory with all libraries used by myapp)
lib1.jar
lib2.jar
+ myapp.jar (my application: either as jar file, or in directories
org/myname/myapp/..)
+ moreresources/
With this directory layout, I can run my application with commands like:
./bin/myapp.sh -arg1 value1 -arg2 value2
Unfortunately, I have not discovered a good way to install the application
using this directory layout. My current solution is to use the assembly plugin
and execute the assembly:directory target. I'm using the following
configuration for the assembly plugin.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
When executing the assembly:directory plugin, the application gets installed in directory target/myapp-1.0-SNAPSHOT-jar-with-dependencies, but all jar files myapp depends on are unpacked. Since my application depends on many, large jar files this step is simply too time-consuming for frequent rebuilds.
In particular, the assembly plugin seems incapable of dealing with incremental
changes and hence the jar files are unpacked every time assembly:directory is
executed.
I would prefer that the build process figures out which jar files to include in
the lib directory from the project dependencies in pom.xml, but that the jar
files are not unpacked.
Is there a better way, to achieve the installation of the application in a
directory?
Best regards,
Christian
--
Christian Plessl <[EMAIL PROTECTED]> http://plesslweb.ch
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]