Add option to get maven sources

This commit is contained in:
Bruce Collie 2024-02-29 11:48:33 +00:00
parent cd7f814c69
commit bd91833ef6

View File

@ -13,6 +13,7 @@
, mvnFetchExtraArgs ? { } , mvnFetchExtraArgs ? { }
, mvnDepsParameters ? "" , mvnDepsParameters ? ""
, manualMvnArtifacts ? [ ] , manualMvnArtifacts ? [ ]
, manualMvnSources ? [ ]
, mvnParameters ? "" , mvnParameters ? ""
, ... , ...
} @args: } @args:
@ -39,6 +40,14 @@ let
echo "downloading manual $artifactId" echo "downloading manual $artifactId"
mvn dependency:get -Dartifact="$artifactId" -Dmaven.repo.local=$out/.m2 mvn dependency:get -Dartifact="$artifactId" -Dmaven.repo.local=$out/.m2
done done
for artifactId in ${builtins.toString manualMvnSources}
do
group=$(echo $artifactId | cut -d':' -f1)
artifact=$(echo $artifactId | cut -d':' -f2)
echo "downloading manual sources $artifactId"
mvn dependency:sources -DincludeGroupIds="$group" -DincludeArtifactIds="$artifact" -Dmaven.repo.local=$out/.m2
done
'' + lib.optionalString (!buildOffline) '' '' + lib.optionalString (!buildOffline) ''
mvn package -Dmaven.repo.local=$out/.m2 ${mvnParameters} mvn package -Dmaven.repo.local=$out/.m2 ${mvnParameters}
'' + '' '' + ''