diff --git a/pkgs/build-support/build-maven.nix b/pkgs/build-support/build-maven.nix index 26be7d2aebb7..646b32435837 100644 --- a/pkgs/build-support/build-maven.nix +++ b/pkgs/build-support/build-maven.nix @@ -1,4 +1,4 @@ -{ stdenv, maven, runCommand, writeText, fetchurl, lib }: +{ stdenv, maven, runCommand, writeText, fetchurl, lib, requireFile }: /* Takes an info file generated by mvn2nix * (https://github.com/NixOS/mvn2nix-maven-plugin) and builds the maven * project with it. @@ -15,9 +15,11 @@ infoFile: let script = writeText "build-maven-repository.sh" '' ${lib.concatStrings (map (dep: let - inherit (dep) url sha1 groupId artifactId version; + inherit (dep) url sha1 groupId artifactId version authenticated; - fetch = fetchurl { inherit url sha1; }; + fetch = (if authenticated then requireFile else fetchurl) { + inherit url sha1; + }; in '' dir=$out/$(echo ${groupId} | sed 's|\.|/|g')/${artifactId}/${version} mkdir -p $dir