Issue
I'm trying to build a spring-boot
maven project from a jenkins pipeline.
Error:
ERROR: Failed to parse POMs
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for xxx.xxxxx.xxxx:finance-portal:0.0.1-SNAPSHOT:
Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.4.2
Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.4.2
from/to central (https://repo.maven.apache.org/maven2):
Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.24.215] failed:
Connection refused (Connection refused) and 'parent.relativePath' points at no local POM @ line 6, column 10
maven goal:
clean install -U -X
pom.xml:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
The resolutions I tried so far:
Setting up org proxy through
settings.xml
file in jenkins and use the config in the pipeline.Setting up proxies through maven goal:
clean install -DproxySet=true -DproxyHost=proxy.com -DproxyPort=xxxxx
.Omitting/Changing
relativePath
tag in pom.xml to<relativePath>../pom.xml</relativePath>
and few other variants.Remove jenkins workspace for the project and re-build it.
make a
curl
request to maven central repo before the build to check connection establishment:curl -I -x proxy.com:xxxxx "https://repo.maven.apache.org/maven2"
. The connection gets established but fails in the build process.
Solution
While 30thh
's answer was definitely helpful for troubleshooting, as a last resort I just cloned a working VM to a new instance, created my pipeline there and it worked like a charm in the first attempt. So it's pretty evident that it was something to do with proxy/firewall
of the previous VM/jenkins.
Answered By - izengod