Using native packaging formats to install Java applications leverages existing and well-tested tools and infrastructure for software deployment. But one of the perks of Java has always been the cross-platform build. Using the standard native tools to create these native packages breaks the promise of a cross-platform Java build.
With the jdeb project there is a way to create native Debian packages directly from your ant or maven build. It lets you create
Debian packages without using the native tools.
So whether you build on Linux, Windows or macOS you get a valid package that is ready to be deployed.
The only requirement is to add a control file that provides metadata about the package. It declares things like name, version and most importantly dependencies.
Package: [[name]] Version: [[version]] Section: misc Priority: low Architecture: all Description: [[description]] Maintainer: Torsten Curdt <firstname.lastname@example.org> Depends: default-jre | java6-runtime
The integration is easy with ant. Just specify the paths and provide the data that should get included in the package.
With maven jdeb attaches to the package phase. A build now creates the jar then builds the package and attaches it as a secondary artifact.
For more information check out the documentation and the examples or join the community for a chat on gitter.