Packaging a Maven application

The Java wiki is pretty limited at the moment, especially with regards to usage with Maven (a very common Java packager).

There’s an open issue to add documentation for buildMaven specifically via Maven builds are not documented in nixpgs manual · Issue #19741 · NixOS/nixpkgs · GitHub

I took the time however to document the more naiive approach but which doesn’t rely on any 3rd party / community driven integrations.

The solution relies on first capturing all the required dependencies via a fixed output derivation.
I hope anyone who is working with Java & Nix finds it useful.

3 Likes