[Nix-dev] buildMaven usage
laverne
lists-laverne at schrock.email
Sun Feb 19 23:31:21 CET 2017
---- On Wed, 15 Feb 2017 13:08:07 -0600 zimbatm <zimbatm at zimbatm.com> wrote ----
Hi laverne,
did you manage to figure it out?
I think the usage would be to run https://github.com/NixOS/mvn2nix-maven-plugin on your project and then in your default.nix add something like:
```
{ pkgs ? import <nixpkgs> {}
, buildMaven ? pkgs.buildMaven
}:
buildMaven ./infofile
```
Where the `./infofile` is the file generated by mvn2nix (it should be a JSON file).
As you can see not a lot of people are packaging java apps :)
Cheers,
z
On Fri, 10 Feb 2017 at 05:47 laverne <lists-laverne at schrock.email> wrote:
Hi,
I have a question about the function defined at https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/build-maven.nix
I wanted to use it to build Spark Frame (http://sparkjava.com/), however, while the function is in all-packages, it isn't doesn't seem to be used anywhere else in nixpkgs. Is anyone here using the function in other projects that they would be willing to link to so that I could get a feel for how to use it?
Thanks,
Laverne
No, I never did get it to work, but I hadn't tried the exact code that you recommend. Giving it a try produced the same results as other attempts:
<snipped>
building path(s) ‘/nix/store/4swv9zdqzclsfafp0j1hcks3xj47chgh-spark-core-2.5.4.jar’
unpacking sources
unpacking source archive /nix/store/i9zn88vg2s50a6nx5g0wy1xnn1j6rflb-spark
source root is spark
patching sources
configuring
no configure script, doing nothing
building
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.sparkjava:spark-core:2.5.4: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.sonatype.oss:oss-parent:pom:7 has not been downloaded from it before. and 'parent.relativePath' points at wrong local POM @ line 4, column 13
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.sparkjava:spark-core:2.5.4 (/tmp/nix-build-spark-core-2.5.4.jar.drv-0/spark/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.sparkjava:spark-core:2.5.4: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.sonatype.oss:oss-parent:pom:7 has not been downloaded from it before. and 'parent.relativePath' points at wrong local POM @ line 4, column 13 -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
builder for ‘/nix/store/1ygg32yq12p4x5dwqyd23drpkv8ynyc7-spark-core-2.5.4.jar.drv’ failed with exit code 1
error: build of ‘/nix/store/1ygg32yq12p4x5dwqyd23drpkv8ynyc7-spark-core-2.5.4.jar.drv’ failed
So I'm thinking that I'm calling the buildMaven function correctly, but that it (or the mvn2nix plugin) doesn't support some of the features used in this pom.xml.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20170219/a1f15017/attachment.html>
More information about the nix-dev
mailing list