I was trying to build the Spark Framework for NixOS, using this tool. Running mvn org.nixos.mvn2nix:mvn2nix-maven-plugin:mvn2nix
in a checkout of the 2.5.4 branch of the Spark repo produced a project-info.json file that is almost 1 MB.
I then attempted to use the JSON file to with the following function definition:
{ stdenv, buildMaven }:
let
autoGeneratedDerivation = buildMaven /home/spark/project-info.json;
in
autoGeneratedDerivation
This produced the following error:
error: attribute ‘authenticated’ missing, at /nix/store/lwmgp564z0bl06svlnw21gg3qy8kw3vb-nixos-16.09.1512.6b28bd0/nixos/pkgs/build-support/build-maven.nix:17:39
The structure of the JSON is not yet documented (as per #2), but here is what I'm seeing. The JSON file is a map with two keys project
and dependencies
. The value associated with dependencies
is an array of maps, with each map specifying a dependency. e.g.
{
"artifactId": "maven-bundle-plugin",
"groupId": "org.apache.felix",
"version": "2.5.3",
"classifier": "",
"extension": "pom",
"dependencies": [ CONTENT_OMITTED ],
"authenticated": false,
"url": "https://repo.maven.apache.org/maven2/org/apache/felix/maven-bundle-plugin/2.5.3/maven-bundle-plugin-2.5.3.pom",
"sha1": "2ce17ed65ebde5afd0b48781f89f2c372f990c17",
"relocations": [ ]
}
However, some (around 20?) of these maps look different:
{
"artifactId": "apache",
"groupId": "org.apache",
"version": "9",
"classifier": "",
"extension": "pom",
"dependencies": [ ]
}
Thus the buildMaven
function crashes when it tries to inherit
the authenticated
attributed from the parsed JSON.
If tried producing the project-info.json
with both Maven 3.3.9 and 3.2.5, and this issue was in both outputs (although the outputs were slightly different). I'm running NixOS 16.09.
Is this just an instance of #5? I don't really understand what that issue is about.
If any more details are needed, I will do my best to provide them.