Currently, the application plugin creates a distribution containing the runtime dependencies for the application, along with other supporting files. It would be nice to do the same thing for JVM-based libraries.
One approach would be to add a new ‘java-library’ plugin, which does something like:
- Adds a ‘distZip’ task which packages up the jar and runtime dependencies of the library as a Zip. * Include the contents of ‘src/dist’ in the Zip, as the application plugin does.
Some ideas for building on this:
- Generate a Tar distribution as well. * Shared configuration and tasks with the application plugin, by extracting a common ‘dist’ plugin out of the application plugin (this is an advanced move). * Allow the distributions to be published instead of the jar. This would need to mess with the generated pom.xml/ivy.xml to remove the dependency declarations for those dependencies that have been bundled in the distribution (this is an advanced move).