maven: improve buildMavenPackage offline mode

The maven `dependency:go-offline` plugin has various issues
(see https://issues.apache.org/jira/browse/MDEP-204 and other
issues in that tracker), which the dedicated plugin from
https://github.com/qaware/go-offline-maven-plugin largely
fixes. I have confirmed that for an application I'm packaging
outside of nixpkgs, dependency-track, this indeed makes the
build work while it didn't with `dependency:go-offline`.

The offline mode is only used in one place in nixpkgs, for
lemminx. That build still succeeds and the program starts, though
I haven't tested further.
This commit is contained in:
Arnout Engelen 2023-11-14 12:12:18 +01:00
parent e44462d602
commit 3ac1c95cfa
No known key found for this signature in database
GPG key ID: 061107B0F74A6DAA
2 changed files with 2 additions and 2 deletions

View file

@ -35,7 +35,7 @@ maven.buildMavenPackage rec {
"org.junit.platform:junit-platform-launcher:1.10.0"
];
mvnHash = "sha256-sIiCp1AorVQXt13Tq0vw9jGioG3zcQMqqKS/Q0Tf4MQ=";
mvnHash = "sha256-LSnClLdAuqSyyT7O4f4aVaPBxdkkZQz60wTmqwQuzdU=";
buildOffline = true;

View file

@ -32,7 +32,7 @@ let
buildPhase = ''
runHook preBuild
'' + lib.optionalString buildOffline ''
mvn dependency:go-offline -Dmaven.repo.local=$out/.m2 ${mvnDepsParameters}
mvn de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies -Dmaven.repo.local=$out/.m2 ${mvnDepsParameters}
for artifactId in ${builtins.toString manualMvnArtifacts}
do