Nur error not reproducible

My NUR keeps having issues in the github CI, but I can’t replicate these at all.

error: builder for '/nix/store/nzxm3yb9fvc2srn24mq2wb2b7lvds7dh-harbor-1.6.4-b1.drv' failed with exit code 1;
       last 10 log lines:
       > [INFO] Finished at: 2023-11-19T20:10:59Z
       > [INFO] ------------------------------------------------------------------------
Error: > [ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:3.3.1 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven.plugins:maven-resources-plugin:jar:3.3.1 (absent): Cannot access central ( in offline mode and the artifact org.apache.maven.plugins:maven-resources-plugin:jar:3.3.1 has not been downloaded from it before. -> [Help 1]
Error: > [ERROR]
Error: > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
Error: > [ERROR] Re-run Maven using the -X switch to enable full debug logging.
Error: > [ERROR]
Error: > [ERROR] For more information about the errors and possible solutions, please read the following articles:
Error: > [ERROR] [Help 1]
       For full logs, run 'nix log /nix/store/nzxm3yb9fvc2srn24mq2wb2b7lvds7dh-harbor-1.6.4-b1.drv'.
nix-build-uncached: nix build failed: exit status 1

Error: Process completed with exit code 1.

Shouldn’t this lead to the same error?

 nix shell -I nixpkgs=channel:nixos-unstable -f '<nixpkgs>' nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs

my only guess is that when i ran this against 23.05 it already cached those maven artifacts but nixos-unstable buildMaven is broken?

1 Like

I’m getting the error starting today too.
maven java frequently fails to build,

I solved the error after working for half a day.

maven.buildMavenPackage rec {  
      pname = "hello-world";
      version = "1.0-SNAPSHOT";
      NAME = "${pname}-${version}";
      src = ./.;
      mvnHash = "sha256-oVfLWIly+LA27BaLjzJ35SiDrEfgYmIG/lXZtPUSYog=";
      nativeBuildInputs = [ makeWrapper ];

installPhase = ''
  runHook preInstall
  mkdir -p $out/bin
  cp target/${NAME}.jar $out/
  makeWrapper ${jdk}/bin/java $out/bin/mvn-${pname} \
  --add-flags "-jar $out/${NAME}.jar"

  runHook postInstall



thank you! this does seem to work as long as all plugins are properly pinned.
since i do not control the repository i just added a patch

1 Like