mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
fetchMavenArtifact: add classifier to filename
This commit is contained in:
parent
6c6bc2f650
commit
0bc28dafcd
@ -43,13 +43,15 @@ let
|
|||||||
(lib.replaceStrings ["."] ["_"] artifactId) "-"
|
(lib.replaceStrings ["."] ["_"] artifactId) "-"
|
||||||
version
|
version
|
||||||
];
|
];
|
||||||
|
suffix = if isNull classifier then "" else "-${classifier}";
|
||||||
|
filename = "${artifactId}-${version}${suffix}.jar";
|
||||||
mkJarUrl = repoUrl:
|
mkJarUrl = repoUrl:
|
||||||
lib.concatStringsSep "/" [
|
lib.concatStringsSep "/" [
|
||||||
(lib.removeSuffix "/" repoUrl)
|
(lib.removeSuffix "/" repoUrl)
|
||||||
(lib.replaceStrings ["."] ["/"] groupId)
|
(lib.replaceStrings ["."] ["/"] groupId)
|
||||||
artifactId
|
artifactId
|
||||||
version
|
version
|
||||||
"${artifactId}-${version}${lib.optionalString (!isNull classifier) "-${classifier}"}.jar"
|
filename
|
||||||
];
|
];
|
||||||
urls_ =
|
urls_ =
|
||||||
if url != "" then [url]
|
if url != "" then [url]
|
||||||
@ -68,7 +70,7 @@ in
|
|||||||
# packages packages that mention this derivation in their buildInputs.
|
# packages packages that mention this derivation in their buildInputs.
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/share/java
|
mkdir -p $out/share/java
|
||||||
ln -s ${jar} $out/share/java/${artifactId}-${version}.jar
|
ln -s ${jar} $out/share/java/${filename}
|
||||||
'';
|
'';
|
||||||
# We also add a `jar` attribute that can be used to easily obtain the path
|
# We also add a `jar` attribute that can be used to easily obtain the path
|
||||||
# to the downloaded jar file.
|
# to the downloaded jar file.
|
||||||
|
Loading…
Reference in New Issue
Block a user