buildMaven: Handle authenticated repos

This commit is contained in:
Shea Levy 2015-07-08 06:24:55 -04:00
parent e987d1c1e3
commit a5a8bad0e6
1 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, maven, runCommand, writeText, fetchurl, lib }: { stdenv, maven, runCommand, writeText, fetchurl, lib, requireFile }:
/* Takes an info file generated by mvn2nix /* Takes an info file generated by mvn2nix
* (https://github.com/NixOS/mvn2nix-maven-plugin) and builds the maven * (https://github.com/NixOS/mvn2nix-maven-plugin) and builds the maven
* project with it. * project with it.
@ -15,9 +15,11 @@ infoFile: let
script = writeText "build-maven-repository.sh" '' script = writeText "build-maven-repository.sh" ''
${lib.concatStrings (map (dep: let ${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 '' in ''
dir=$out/$(echo ${groupId} | sed 's|\.|/|g')/${artifactId}/${version} dir=$out/$(echo ${groupId} | sed 's|\.|/|g')/${artifactId}/${version}
mkdir -p $dir mkdir -p $dir