Springboot,maven dependencies error - maven

I have a sample spring boot app to deploy in my system which is throwing me following error.I tried cleaning up the maven files from cache still struck with the issue. Can anyone help me with this. Following is the error I Get
Project build error: Non-resolvable parent POM for com.broad.gateway:com-
gateway:0.0.1-SNAPSHOT: Could not transfer artifact
org.springframework.boot:spring-boot-starter-parent:pom:2.0.2.RELEASE from/to
central (https://repo.maven.apache.org/maven2): connect timed out and
'parent.relativePath' points at no local POM

You are getting connection timeout error. This generally happens when you are behind a corporate firewall and your company restricts connection to maven central or any other repos. Try defining your company specific nexus repository under pom.xml in repositories section.

Related

Project build error: Non-resolvable parent POM for everything is right from my side

I'am unable resolve this issue. As soon as I imported the existence spring boot project or created by myself using spring initializer or using sts tool, Ia'm getting the error in POM.xml. I donnot why its giving the error. I have seen all the related issues in stackoverflow. Some said proxy should be added in setting.xml, other said internet connection but I have 40 mbps speed internet.
**ERROR : ** Project build error: Non-resolvable parent POM for com.techprimers:transactionality-demo:0.0.1-SNAPSHOT: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:1.5.15.RELEASE from http://server:8081/artifactory/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.5.15.RELEASE from/to central (http://server:8081/artifactory/libs-release): server and 'parent.relativePath' points at no local POM
As from error, it is clear that maven is trying to download jars from http://server:8081/ and it couldn't able to access it
If http://server:8081/ is custom repository, try to check whether your are able to access it.
If you have no idea about http://server:8081/ server. Then check your ~/.m2/settings.xml or /%maven_root%/conf/settings.xml.
Settings.xml has to be configured with accessible repository or try to setup new maven from https://maven.apache.org/download.cgi

Git runner - problem to download dependency

I have one project that uses the git runner.
The command mvn package works fine on local, all dependencies are downloaded from my local nexus.
When I execute build command at the git runner environment, all dependencies from my local nexus where downloaded without problem too, but only one dependency is a problem, lets see:
[ERROR] Failed to execute goal on project sic: Could not resolve dependencies for project com.example:sic:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at br.com.sspds:ojdbc6:jar:1.0.1: Failed to read artifact descriptor for br.com.sspds:ojdbc6:jar:1.0.1: Could not transfer artifact br.com.sspds:ojdbc6:pom:1.0.1 from/to Nexus (http://172.25.100.75:8090/repository/maven-public/): Transfer failed for http://172.25.100.75:8090/repository/maven-public/br/com/sspds/ojdbc6/1.0.1/ojdbc6-1.0.1.pom: No route to host (Host unreachable)
One big detail: the library ojdbc6-1.0.1.jar was developed by our team and made available manually on our nexus server.
My configuration from nexus server is into my pom.xml.
Any idea about this problem?

Configuring Local Nexus Server

I configured a Nexus server locally on my computer. And I configured several proxy for the company repositories and for the maven-central. If I type the url for an artifact in the browser such as http://localhost:2312/repository/my_repo/junit/junit/4.9/junit-4.9.jar the artifact is downloaded without problems.
But when I try to run the build using the prompt, when I type mvn clean install I get the message:Failed to read artifact descriptor for junit:junit:jar:4.9: Could not transfer artifact junit:junit:pom:4.9 from/to Nexus (http://localhost:2312/repository/my_repo/): Failed to transfer file: http://localhost:2312/repository/my_repo/junit/junit/4.9/junit-4.9.pom. Return code is: 504, ReasonPhrase: Gateway Timeout.
Can anyone tell me what I'm doing wrong, or forgetting to do?

How to resolve codehaus "service unavailable" maven build error?

As codehaus repository is no longer available, I get the following error whenever I try to do "Run As - Maven install" in Eclipse. Below is the error that I get:
[WARNING] Could not transfer metadata
org.eclipse.core:commands/maven-metadata.xml from/to Codehaus Internal
(http://repository.codehaus.org): Failed to transfer
http://repository.codehaus.org/org/eclipse/core/commands/maven-metadata.xml.
Error code 503, Service Temporarily Unavailable Downloading:
http://repository.codehaus.org/org/eclipse/equinox/common/maven-metadata.xml
I also see that maven dependency problem has started coming up for one of the jar files that is not there in Demosite -> pom.xml. Below is the complete error information:
ArtifactDescriptorException: Failed to read artifact descriptor for
org.restlet.jee:org.restlet:jar:2.1.1: ArtifactResolutionException:
Failure to transfer org.restlet.jee:org.restlet:pom:2.1.1 from
http://repository.codehaus.org was cached in the local repository,
resolution will not be reattempted until the update interval of
Codehaus Internal has elapsed or updates are forced. Original error:
Could not transfer artifact org.restlet.jee:org.restlet:pom:2.1.1
from/to Codehaus Internal (http://repository.codehaus.org): Failed to
transfer
http://repository.codehaus.org/org/restlet/jee/org.restlet/2.1.1/org.restlet-2.1.1.pom.
Error code 503, Service Temporarily Unavailable
How to resolve these 2 blockers?
Since Codehaus.org artifacts have all been transfered to Central, one easy way to keep using legacy pom.xml files is to declare the mirror as such in your settings.xml, e.g. :
<mirror>
<id>RIP Codehaus</id>
<mirrorOf>codehaus.org</mirrorOf>
<name>Codehaus.org repo is now in Central. R.I.P.</name>
<url>http://repo.maven.apache.org/maven2</url>
</mirror>
From the Codehaus services 503 message:
All Codehaus services will be terminated progressively until May 17th 2015
If you have been directed here, then the service you are accessing may have been disabled already, or we are trying to get your attention by blacking out services early.
See more detailed information here: https://www.codehaus.org/
If you have these repositories configured in any pom.xml or settings.xml you need to change these to another or just remove these, if these dependencies are in the default repository.
For example, for restlet you may use this repository: http://maven.restlet.com/
If this repository is in a pom.xml from a dependecy, just let pass this message, the download will be tried in another repository.
We have removed this repository from the Broadleaf pom.xml, thanks for pointing it out. This was originally added because MVEL did not have a Java 8-compatible jar uploaded to Maven Central.
See https://github.com/BroadleafCommerce/BroadleafCommerce/issues/1367 for reference.
the codehaus repository is mirrored Mulesoft in the following repo:
https://repository.mulesoft.org/nexus/content/repositories/public/

mvn cannot download a jar issue

when I build a project in linux environment, it says:
[ERROR] Plugin org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-enforcer-plugin:jar:1.0-beta-1: Could not transfer artifact org.apache.maven.plugins:maven-enforcer-plugin:pom:1.0-beta-1 from/to Main Maven Repo (http://repo1.maven.org/maven2/): repo1.maven.org: Unknown host repo1.maven.org -> [Help 1]
I'm using my company internal mirror repository.
Any one help me?
Update:
I copied the .m2 folder to the linux home/user_name , resolved this issue
If you want to use only your company's repo and not the public ones, such as maven central, take a look here Disable Maven central repository.
Otherwise you need your station/network configured to allow access to the public repos and resolve their IPs from the hostnames.

Resources