From 4c766274c5669616be17af6f9cece3112cbae4ee Mon Sep 17 00:00:00 2001 From: Johannes Schleifenbaum Date: Mon, 28 Mar 2022 12:13:09 +0200 Subject: [PATCH 1/2] javaPackages.mavenfod: use mvnParameters in buildPhase --- pkgs/development/java-modules/maven-fod.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/java-modules/maven-fod.nix b/pkgs/development/java-modules/maven-fod.nix index 24ce572af574..5b65c83c659c 100644 --- a/pkgs/development/java-modules/maven-fod.nix +++ b/pkgs/development/java-modules/maven-fod.nix @@ -49,7 +49,7 @@ stdenv.mkDerivation (rec { runHook preBuild mvnDeps=$(cp -dpR ${fetchedMavenDeps}/.m2 ./ && chmod +w -R .m2 && pwd) - mvn package --offline "-Dmaven.repo.local=$mvnDeps/.m2" -P desktop,all-platforms + mvn package --offline "-Dmaven.repo.local=$mvnDeps/.m2" ${mvnParameters} runHook postBuild ''; From 60566767704d7eea7273dbc453374d4f7440ebda Mon Sep 17 00:00:00 2001 From: Johannes Schleifenbaum Date: Mon, 28 Mar 2022 12:26:26 +0200 Subject: [PATCH 2/2] dbeaver: use overridden maven in javaPackages.mavenfod fixes dbeaver> [ERROR] Internal error: org.eclipse.tycho.core.ee.UnknownEnvironmentException: Unknown OSGi execution environment: 'JavaSE-17' -> [Help 1] dbeaver> org.apache.maven.InternalErrorException: Internal error: org.eclipse.tycho.core.ee.UnknownEnvironmentException: Unknown OSGi execution environment: 'JavaSE-17' dbeaver> at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120) dbeaver> at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972) dbeaver> at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) dbeaver> at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) dbeaver> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) dbeaver> at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77) dbeaver> at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) dbeaver> at java.lang.reflect.Method.invoke (Method.java:568) dbeaver> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) dbeaver> at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) dbeaver> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) dbeaver> at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) --- pkgs/applications/misc/dbeaver/default.nix | 35 ++++------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/pkgs/applications/misc/dbeaver/default.nix b/pkgs/applications/misc/dbeaver/default.nix index d713afc96a3f..bcb6f87ab1d3 100644 --- a/pkgs/applications/misc/dbeaver/default.nix +++ b/pkgs/applications/misc/dbeaver/default.nix @@ -19,9 +19,11 @@ , javaPackages }: -javaPackages.mavenfod rec { +(javaPackages.mavenfod.override { + inherit maven; # use overridden maven version (see dbeaver's entry in all-packages.nix) +}) rec { pname = "dbeaver"; - version = "22.0.1"; # When updating also update fetchedMavenDeps.sha256 + version = "22.0.1"; # When updating also update mvnSha256 src = fetchFromGitHub { owner = "dbeaver"; @@ -30,36 +32,9 @@ javaPackages.mavenfod rec { sha256 = "sha256-IG5YWwq3WVzQBvAslQ9Z2Ou6ADzf4n9NkQCtH4Jgkac="; }; - - mvnSha256 = "7Sm1hAoi5xc4MLONOD8ySLLkpao0qmlMRRva/8zR210="; + mvnSha256 = "WAB15d4UvUOkBXT7K/hvAZWOE3V1Lpl/tr+AFNBM4FI="; mvnParameters = "-P desktop,all-platforms"; - fetchedMavenDeps = stdenv.mkDerivation { - name = "dbeaver-${version}-maven-deps"; - inherit src; - - buildInputs = [ - maven - ]; - - buildPhase = "mvn package -Dmaven.repo.local=$out/.m2 ${mvnParameters}"; - - # keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with lastModified timestamps inside - installPhase = '' - find $out -type f \ - -name \*.lastUpdated -or \ - -name resolver-status.properties -or \ - -name _remote.repositories \ - -delete - ''; - - # don't do any fixup - dontFixup = true; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "sha256-WAB15d4UvUOkBXT7K/hvAZWOE3V1Lpl/tr+AFNBM4FI="; - }; - nativeBuildInputs = [ copyDesktopItems makeWrapper