[Nix-dev] Maven support in nix

Corey O'Connor coreyoconnor at gmail.com
Wed Apr 9 19:33:37 CEST 2014


Here is a nix package for jenkins that will build from a maven project:

https://github.com/coreyoconnor/nixpkgs/tree/c8bd7bc3d1a6803d315790edfb2c96aad0170257/pkgs/development/tools/continuous-integration/jenkins

The process has some issues still. This ended up working OK:
1. Create a derivation for the maven dependencies of the project. This
required adding a maven settings file which set the local repository to
"${env.out}"
* maven settings:
https://github.com/coreyoconnor/nixpkgs/blob/c8bd7bc3d1a6803d315790edfb2c96aad0170257/pkgs/development/tools/continuous-integration/jenkins/m2_settings.xml
* builder:
https://github.com/coreyoconnor/nixpkgs/blob/c8bd7bc3d1a6803d315790edfb2c96aad0170257/pkgs/development/tools/continuous-integration/jenkins/initialize_m2_repo.sh
2. Create a derivation for the project build itself. Have this project's
localRepository be a *copy* of the output of the m2_repo derivation.
* builder:
https://github.com/coreyoconnor/nixpkgs/blob/c8bd7bc3d1a6803d315790edfb2c96aad0170257/pkgs/development/tools/continuous-integration/jenkins/builder.sh

Without separate derivations for the m2 repo and the project the re-build
cycle was painful. A rebuild would including fetching the maven universe.

issues with the implementation linked to above:
* the target built for "building the maven repository" is the jenkins cli.
I bet there is a maven target specific to this goal. That should be used.
* copying the maven repository around is expensive. I presume there are
some maven repository reference settings that could be used to resolve
this. Multiple local repositories? I dunno.

Cheers,
Corey


-Corey O'Connor
coreyoconnor at gmail.com
http://corebotllc.com/


On Sun, Apr 6, 2014 at 1:51 PM, shacka <shacka at gmail.com> wrote:

> Hey Nixers,
>
> is it possible to build maven project as nix package?
>
> Thanks,
> Andrii
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20140409/715def34/attachment.html 


More information about the nix-dev mailing list