diff options
author | Arnout Engelen <arnout@bzzt.net> | 2021-02-22 21:45:26 +0000 |
---|---|---|
committer | Arnout Engelen <arnout@bzzt.net> | 2021-02-23 09:22:40 +0100 |
commit | ed5b9cce76c4de98e2d86272cb79cdd5642db532 (patch) | |
tree | d51e39cf41d9050e7f4cd38fbb8a48b1facb94ba /pkgs/development/java-modules | |
parent | 9816b99e71c3504b0b4c1f8b2e004148460029d4 (diff) |
maven: use default jdk
While builds using maven are relatively likely to target jdk8, they typically support building using default jdk. The main exception is the default jdk no longer supports targeting JRE's before version 8. For projects that do that we can override the jdk version for the maven used there.
Diffstat (limited to 'pkgs/development/java-modules')
-rw-r--r-- | pkgs/development/java-modules/junit/default.nix | 9 | ||||
-rw-r--r-- | pkgs/development/java-modules/maven-hello/default.nix | 16 |
2 files changed, 21 insertions, 4 deletions
diff --git a/pkgs/development/java-modules/junit/default.nix b/pkgs/development/java-modules/junit/default.nix index 2cb9ab001c29b..79f73879e6b91 100644 --- a/pkgs/development/java-modules/junit/default.nix +++ b/pkgs/development/java-modules/junit/default.nix @@ -1,12 +1,17 @@ -{ lib, pkgs, mavenbuild, fetchMaven }: +{ lib, pkgs, mavenbuild, fetchMaven, maven, jdk8 }: with pkgs.javaPackages; let poms = import (../poms.nix) { inherit fetchMaven; }; collections = import (../collections.nix) { inherit pkgs; }; + mavenbuild-jdk8 = mavenbuild.override { + maven = maven.override { + jdk = jdk8; + }; + }; in rec { - junitGen = { mavenDeps, sha512, version }: mavenbuild { + junitGen = { mavenDeps, sha512, version }: mavenbuild-jdk8 { inherit mavenDeps sha512 version; name = "junit-${version}"; diff --git a/pkgs/development/java-modules/maven-hello/default.nix b/pkgs/development/java-modules/maven-hello/default.nix index eac127b6dccc7..96d0031270b8e 100644 --- a/pkgs/development/java-modules/maven-hello/default.nix +++ b/pkgs/development/java-modules/maven-hello/default.nix @@ -1,11 +1,21 @@ -{ lib, pkgs, mavenbuild }: +{ lib +, pkgs +, mavenbuild +, maven +, jdk8 +}: with pkgs.javaPackages; let poms = import ../poms.nix { inherit fetchMaven; }; + mavenbuild-jdk8 = mavenbuild.override { + maven = maven.override { + jdk = jdk8; + }; + }; in rec { - mavenHelloRec = { mavenDeps, sha512, version, skipTests ? true, quiet ? true }: mavenbuild { + mavenHelloRec = { mavenDeps, mavenbuild, sha512, version, skipTests ? true, quiet ? true }: mavenbuild { inherit mavenDeps sha512 version skipTests quiet; name = "maven-hello-${version}"; @@ -31,6 +41,7 @@ in rec { mavenDeps = []; sha512 = "3kv5z1i02wfb0l5x3phbsk3qb3wky05sqn4v3y4cx56slqfp9z8j76vnh8v45ydgskwl2vs9xjx6ai8991mzb5ikvl3vdgmrj1j17p2"; version = "1.0"; + mavenbuild = mavenbuild-jdk8; }; mavenHello_1_1 = mavenHelloRec { @@ -39,5 +50,6 @@ in rec { version = "1.1"; skipTests = false; quiet = false; + mavenbuild = mavenbuild-jdk8; }; } |