2016-10-30 15:41:20 +00:00
|
|
|
{ stdenv, fetchurl }:
|
2016-11-16 17:39:59 +00:00
|
|
|
{ version, artifactId, groupId, sha512, type ? "jar", suffix ? "" }:
|
2016-10-30 15:41:20 +00:00
|
|
|
|
|
|
|
let
|
2016-11-16 17:39:59 +00:00
|
|
|
name = "${artifactId}-${version}";
|
|
|
|
m2Path = "${builtins.replaceStrings ["."] ["/"] groupId}/${artifactId}/${version}";
|
2016-10-31 17:25:27 +00:00
|
|
|
m2File = "${name}${suffix}.${type}";
|
2019-08-13 22:52:01 +01:00
|
|
|
src = fetchurl {
|
2016-10-30 15:41:20 +00:00
|
|
|
inherit sha512;
|
|
|
|
url = "mirror://maven/${m2Path}/${m2File}";
|
|
|
|
};
|
2019-08-13 22:52:01 +01:00
|
|
|
in stdenv.mkDerivation {
|
2016-10-30 15:41:20 +00:00
|
|
|
inherit name m2Path m2File src;
|
|
|
|
|
2021-08-15 12:12:44 +01:00
|
|
|
dontUnpack = true;
|
|
|
|
|
2016-10-30 15:41:20 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/m2/$m2Path
|
|
|
|
cp $src $out/m2/$m2Path/$m2File
|
|
|
|
'';
|
|
|
|
}
|