tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
buildMaven: Handle authenticated repos
Shea Levy
10 years ago
a5a8bad0
e987d1c1
+5
-3
1 changed file
expand all
collapse all
unified
split
pkgs
build-support
build-maven.nix
+5
-3
pkgs/build-support/build-maven.nix
···
1
1
-
{ stdenv, maven, runCommand, writeText, fetchurl, lib }:
1
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
18
-
inherit (dep) url sha1 groupId artifactId version;
18
18
+
inherit (dep) url sha1 groupId artifactId version authenticated;
19
19
20
20
-
fetch = fetchurl { inherit url sha1; };
20
20
+
fetch = (if authenticated then requireFile else fetchurl) {
21
21
+
inherit url sha1;
22
22
+
};
21
23
in ''
22
24
dir=$out/$(echo ${groupId} | sed 's|\.|/|g')/${artifactId}/${version}
23
25
mkdir -p $dir