diff options
author | superherointj <5861043+superherointj@users.noreply.github.com> | 2024-06-02 20:29:33 -0300 |
---|---|---|
committer | superherointj <5861043+superherointj@users.noreply.github.com> | 2024-06-02 21:35:13 -0300 |
commit | a2ab68ab9263224bb01b92a62852ef741dd6880f (patch) | |
tree | c64a002dbfd26858f2fc905b96e1456467a64fb1 /pkgs/development/tools/build-managers | |
parent | df2577c6a4938e291283b0d8fab175bf72a86b73 (diff) |
buildMavenPackage: add doCheck support
Diffstat (limited to 'pkgs/development/tools/build-managers')
-rw-r--r-- | pkgs/development/tools/build-managers/apache-maven/build-package.nix | 6 |
1 files changed, 4 insertions, 2 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 df5d67cb42e6b..f9ff54696dfe9 100644 --- a/pkgs/development/tools/build-managers/apache-maven/build-package.nix +++ b/pkgs/development/tools/build-managers/apache-maven/build-package.nix @@ -6,6 +6,7 @@ { src , sourceRoot ? null , buildOffline ? false +, doCheck ? true , patches ? [ ] , pname , version @@ -22,6 +23,7 @@ # created to allow using maven packages in the same style as rust let + mvnSkipTests = lib.optionalString (!doCheck) "-DskipTests"; fetchedMavenDeps = stdenv.mkDerivation ({ name = "${pname}-${version}-maven-deps"; inherit src sourceRoot patches; @@ -49,7 +51,7 @@ let mvn dependency:sources -DincludeGroupIds="$group" -DincludeArtifactIds="$artifact" -Dmaven.repo.local=$out/.m2 done '' + lib.optionalString (!buildOffline) '' - mvn package -Dmaven.repo.local=$out/.m2 ${mvnParameters} + mvn package -Dmaven.repo.local=$out/.m2 ${mvnSkipTests} ${mvnParameters} '' + '' runHook postBuild ''; @@ -85,7 +87,7 @@ stdenv.mkDerivation (builtins.removeAttrs args [ "mvnFetchExtraArgs" ] // { runHook preBuild mvnDeps=$(cp -dpR ${fetchedMavenDeps}/.m2 ./ && chmod +w -R .m2 && pwd) - mvn package -o -nsu "-Dmaven.repo.local=$mvnDeps/.m2" ${mvnParameters} + mvn package -o -nsu "-Dmaven.repo.local=$mvnDeps/.m2" ${mvnSkipTests} ${mvnParameters} runHook postBuild ''; |