spring-boot build
PlumpMath opened this issue · 3 comments
Hello
code: https://github.com/PlumpMath/gurupoo
When attempting to generate the 'mvn2nix-lock.json' file using the
'mvn2nix > mvn2nix-lock.json' command, an error occurred.
As a workaround, the
mvn2nix --goals clean > mvn2nix-lock.json
command was used to successfully generate the file.
This is a very simple Spring project that can be executed using 'mvn spring-boot:run' without any involvement of Nix, and accessed via 'localhost:8080/hello?name=helloworld'.
To generate a JAR file, the commands 'mvn clean package spring-boot:repackage' or 'mvn clean install spring-boot:repackage' (without 'clean') can be used.
However, attempting to build the project using Nix results in an error.
Thanks.
solve.
mvn -Dmaven.repo.local=$out install spring-boot:repackage
or
mvn -Dmaven.repo.local=$out package spring-boot:repackage
-Dmaven.repo.local=$out
this
However, it fails on NixOS. It succeeds on all Linux environments with Nix except for Mac (Intel, M2) and NixOS.
It seems to be because of sudo, but I'm not entirely sure. To find out, I would have to build that code in user mode, as NixOS installs everything with flake.nix. Anyway, I hope it gets resolved later on.
When I tried building it in user mode with nix-build, I got this error on NixOS.
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for plumpmath:gurupoo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.7.11 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.7.11/spring-boot-starter-parent-2.7.11.pom and 'parent.relativePath' points at no local POM @ line 5, column 11
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project plumpmath:gurupoo:0.0.1-SNAPSHOT (/build/source/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for plumpmath:gurupoo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.7.11 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.7.11/spring-boot-starter-parent-2.7.11.pom and 'parent.relativePath' points at no local POM @ line 5, column 11: Unknown host repo.maven.apache.org: Temporary failure in name resolution -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
error: builder for '/nix/store/xnajxhhb3lf7g4mgibqmbh5zld62rj7g-gurupoo-0.0.1-SNAPSHOT.drv' failed with exit code 1;
last 10 log lines:
> [ERROR] The project plumpmath:gurupoo:0.0.1-SNAPSHOT (/build/source/pom.xml) has 1 error
> [ERROR] Non-resolvable parent POM for plumpmath:gurupoo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.7.11 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.7.11/spring-boot-starter-parent-2.7.11.pom and 'parent.relativePath' points at no local POM @ line 5, column 11: Unknown host repo.maven.apache.org: Temporary failure in name resolution -> [Help 2]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please read the following articles:
> [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
> [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
>
For full logs, run 'nix log /nix/store/xnajxhhb3lf7g4mgibqmbh5zld62rj7g-gurupoo-0.0.1-SNAPSHOT.drv'.