From 0e10bfa24646637e7054eb8235b260e02c6953a0 Mon Sep 17 00:00:00 2001 From: NeQuissimus Date: Mon, 14 Nov 2016 19:23:08 -0500 Subject: [PATCH] maven_hello: Add 1.1, add ability to choose skipping tests --- pkgs/development/java-modules/build-maven-package.nix | 4 ++-- pkgs/development/java-modules/maven-hello/default.nix | 11 +++++++++-- pkgs/top-level/java-packages.nix | 3 ++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/development/java-modules/build-maven-package.nix b/pkgs/development/java-modules/build-maven-package.nix index 203fa88aa00b..10dabadb50c8 100644 --- a/pkgs/development/java-modules/build-maven-package.nix +++ b/pkgs/development/java-modules/build-maven-package.nix @@ -1,5 +1,5 @@ { stdenv, maven, pkgs }: -{ mavenDeps, src, name, meta, m2Path, ... }: +{ mavenDeps, src, name, meta, m2Path, skipTests ? true, ... }: with builtins; with stdenv.lib; @@ -26,7 +26,7 @@ in stdenv.mkDerivation rec { echo "\ tmpm2file://$out/m2*\ $out/m2" >> $out/m2/settings.xml - ${maven}/bin/mvn clean package -Dmaven.test.skip=true -Danimal.sniffer.skip=true -gs $out/m2/settings.xml + ${maven}/bin/mvn clean package -Dmaven.test.skip=${if skipTests then "true" else "false"} -Danimal.sniffer.skip=true -gs $out/m2/settings.xml cp -v ./target/*.jar $out/target/ ''; } diff --git a/pkgs/development/java-modules/maven-hello/default.nix b/pkgs/development/java-modules/maven-hello/default.nix index feb3146ffd61..a1a6cfce6b42 100644 --- a/pkgs/development/java-modules/maven-hello/default.nix +++ b/pkgs/development/java-modules/maven-hello/default.nix @@ -3,8 +3,8 @@ with pkgs.javaPackages; rec { - mavenHelloRec = { mavenDeps, sha512, version }: mavenbuild rec { - inherit mavenDeps sha512 version; + mavenHelloRec = { mavenDeps, sha512, version, skipTests }: mavenbuild rec { + inherit mavenDeps sha512 version skipTests; name = "maven-hello-${version}"; src = pkgs.fetchFromGitHub { @@ -30,4 +30,11 @@ rec { sha512 = "3kv5z1i02wfb0l5x3phbsk3qb3wky05sqn4v3y4cx56slqfp9z8j76vnh8v45ydgskwl2vs9xjx6ai8991mzb5ikvl3vdgmrj1j17p2"; version = "1.0"; }; + + mavenHello_1_1 = mavenHelloRec { + mavenDeps = [ junit_4_12 ]; + sha512 = "3dhgl5z3nzqskjjcggrjyz37r20b0m5vhfzbx382qyqcy4d2jdhkl7v1ajhcg8vkz0qdzq85k09w5is81hybv8sd09h3hgb3rrigdaq"; + version = "1.1"; + skipTests = false; + }; } diff --git a/pkgs/top-level/java-packages.nix b/pkgs/top-level/java-packages.nix index 2865418eb923..488f4cb59db8 100644 --- a/pkgs/top-level/java-packages.nix +++ b/pkgs/top-level/java-packages.nix @@ -104,7 +104,8 @@ in { mavenFiltering_1_1; inherit (callPackage ../development/java-modules/maven-hello { inherit mavenbuild; }) - mavenHello_1_0; + mavenHello_1_0 + mavenHello_1_1; inherit (callPackage ../development/java-modules/maven/model.nix { inherit fetchMaven; }) mavenModel_2_0_6