Maven plugin that outputs dependency information suitable for bash script to download. This is reasonable tradeoff between creating fat jar and installing full jdk, maven with ton of dependencies.
Parameter | Default value | Description |
---|---|---|
repositories | ${project.build.directory}/repositories.txt | file with repositories used by project. Every repository on separate line. |
dependencies | ${project.build.directory}/dependencies.txt | file with dependencies and transitive dependencies. Every dependency on separate line. Format suitable for download. I.e. ```/com/example/artifact/1.0/artifact-1.0.jar``` |
script | ${project.build.directory}/download-dependencies.sh | script that could download dependencies from repositories. no maven required. |
excludes | List of artifacts to exclude. This is very useful to exclude artifacts from the private repositories. The pattern follows maven assembly plugin |
<plugin>
<groupId>com.aerse.maven</groupId>
<artifactId>deps-maven-plugin</artifactId>
<configuration>
<repositories>${project.build.directory}/deps/repositories.txt</repositories>
<dependencies>${project.build.directory}/deps/dependencies.txt</dependencies>
<script>${project.build.directory}/deps/script.sh</script>
<excludes>
<exclude>com.examples:*:*<exclude>
</excludes>
</configuration>
</plugin
The directory ${project.build.directory}/deps
will contain everything required for .jar download. For example this directory could be used by assembly plugin to generate result binary.
After unpacking on target machine, execute script: ./script.sh . /usr/share/java/applicaiton/
. Script supports the following arguments:
- Directory with repositories.txt and dependencies.txt files
- Directory where to output downloaded dependencies