NixOS / mvn2nix-maven-plugin

Generate project-info.json for use with nix's Maven repository generation functions
MIT License
31 stars 21 forks source link

Add sample nix expression in README #6

Open triblix opened 9 years ago

triblix commented 9 years ago

I wanted to fix the broken NixOS junit package but the README only describes how to generate the project-info.json file

I tried replacing the junit expression in all-packages.nix with

junit = buildMaven ../development/libraries/java/junit/project-info.json ;

and nix happily built the maven dependencies but unfortunately this did not build junit.

$ nix-build -A junit
these derivations will be built:
  /nix/store/xmzd1x46zv5yjp5wfp9qhkclgl7nycg2-junit-4.12.jar.drv
building path(s) ‘/nix/store/vzazijmzb9v7grxfrbdzmjc50ypslzin-junit-4.12.jar’
unpacking sources
unpacking source archive /nix/store/02x8ms0rwcfpgcifdav5na4c6bc2sinb-junit
source root is junit
patching sources
configuring
no configure script, doing nothing
building
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.049 s
[INFO] Finished at: 2015-10-03T22:09:43+00:00
[INFO] Final Memory: 7M/303M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/tmp/nix-build-junit-4.12.jar.drv-0/junit). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
builder for ‘/nix/store/xmzd1x46zv5yjp5wfp9qhkclgl7nycg2-junit-4.12.jar.drv’ failed with exit code 1
error: build of ‘/nix/store/xmzd1x46zv5yjp5wfp9qhkclgl7nycg2-junit-4.12.jar.drv’ failed

Thanks in advance!

schmittlauch commented 5 years ago

I found a blog post trying to describe building a package with mvn2nix an buildMaven, but haven't verified it yet: https://ww.telent.net/2017/5/10/building_maven_packages_with_nix