diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-09-18 22:02:49 +0200 |
---|---|---|
committer | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-09-18 22:02:49 +0200 |
commit | d03e80e2537bfae06ce57b44448a2d29613e97d7 (patch) | |
tree | 5ac004195ab9345dc45cb5d284e8b5bbab47d87c | |
parent | 6e05e49f473d43f7db2a147517a90a6b3ff1e860 (diff) |
buildMavenPackage: refactor
-rw-r--r-- | pkgs/development/tools/build-managers/apache-maven/build-package.nix | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/pkgs/development/tools/build-managers/apache-maven/build-package.nix b/pkgs/development/tools/build-managers/apache-maven/build-package.nix index 6d990a699add9..c9d0157d7b157 100644 --- a/pkgs/development/tools/build-managers/apache-maven/build-package.nix +++ b/pkgs/development/tools/build-managers/apache-maven/build-package.nix @@ -29,28 +29,21 @@ let maven ]; - buildPhase = - if buildOffline - then '' - runHook preBuild - - 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 - ''; + buildPhase = '' + runHook preBuild + '' + lib.optionalString buildOffline '' + 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 + '' + 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 = '' |