From a5a8bad0e6b7af11ec25dd34a5dba16fef6c5faa Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 8 Jul 2015 06:24:55 -0400 Subject: [PATCH] buildMaven: Handle authenticated repos --- pkgs/build-support/build-maven.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/build-maven.nix b/pkgs/build-support/build-maven.nix index 26be7d2aebb..646b3243583 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