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