mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-23 21:33:49 +00:00
buildMavenPackage: refactor
This commit is contained in:
parent
6e05e49f47
commit
d03e80e253
@ -29,28 +29,21 @@ let
|
||||
maven
|
||||
];
|
||||
|
||||
buildPhase =
|
||||
if buildOffline
|
||||
then ''
|
||||
runHook preBuild
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
'' + lib.optionalString buildOffline ''
|
||||
mvn dependency:go-offline -Dmaven.repo.local=$out/.m2 ${mvnDepsParameters}
|
||||
|
||||
mvn dependency:go-offline -Dmaven.repo.local=$out/.m2 ${mvnDepsParameters}
|
||||
|
||||
for artifactId in ${builtins.toString manualMvnArtifacts}
|
||||
do
|
||||
echo "downloading manual $artifactId"
|
||||
mvn dependency:get -Dartifact="$artifactId" -Dmaven.repo.local=$out/.m2
|
||||
done
|
||||
|
||||
runHook postBuild
|
||||
''
|
||||
else ''
|
||||
runHook preBuild
|
||||
|
||||
mvn package -Dmaven.repo.local=$out/.m2 ${mvnDepsParameters}
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
for artifactId in ${builtins.toString manualMvnArtifacts}
|
||||
do
|
||||
echo "downloading manual $artifactId"
|
||||
mvn dependency:get -Dartifact="$artifactId" -Dmaven.repo.local=$out/.m2
|
||||
done
|
||||
'' + lib.optionalString (!buildOffline) ''
|
||||
mvn package -Dmaven.repo.local=$out/.m2 ${mvnDepsParameters}
|
||||
'' + ''
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
# keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with lastModified timestamps inside
|
||||
installPhase = ''
|
||||
|
Loading…
Reference in New Issue
Block a user