deps-maven-plugin
![Quality Gate Status](https://camo.githubusercontent.com/dad755197f15ec0381abef2f51de0e7b176fb580c092edcac4c047faa21e7ae2/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d636f6d2e61657273652e6d6176656e253341646570732d6d6176656e2d706c7567696e266d65747269633d616c6572745f737461747573)
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.
configuration
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 |
sample configuraiton
<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