buildMaven: Handle authenticated repos

Shea Levy a5a8bad0 e987d1c1

+5 -3
+5 -3
pkgs/build-support/build-maven.nix
··· 1 - { stdenv, maven, runCommand, writeText, fetchurl, lib }: 1 + { stdenv, maven, runCommand, writeText, fetchurl, lib, requireFile }: 2 2 /* Takes an info file generated by mvn2nix 3 3 * (https://github.com/NixOS/mvn2nix-maven-plugin) and builds the maven 4 4 * project with it. ··· 15 15 16 16 script = writeText "build-maven-repository.sh" '' 17 17 ${lib.concatStrings (map (dep: let 18 - inherit (dep) url sha1 groupId artifactId version; 18 + inherit (dep) url sha1 groupId artifactId version authenticated; 19 19 20 - fetch = fetchurl { inherit url sha1; }; 20 + fetch = (if authenticated then requireFile else fetchurl) { 21 + inherit url sha1; 22 + }; 21 23 in '' 22 24 dir=$out/$(echo ${groupId} | sed 's|\.|/|g')/${artifactId}/${version} 23 25 mkdir -p $dir