m2e Failure to transfer junit - maven

The following issue appear in the Markers view when importing my Maven pom files with m2eclispe:
Failure to transfer junit:junit:jar:3.8.1 from (http://nexus.xyz.com/content/groups/public) 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 junit:junit:jar:3.8.1 from/to central (http://xyz.com/content/groups/public):
The operation was cancelled. pom.xml /project line 1 Maven Configuration Problem
Do I need to add a plugin exclusion filter for m2e to my pom?

Seems like Maven is configured to download any artifacts from your corporate Maven repository. This is a common setup. Usually the corporate Maven repository acts as a proxy to the Maven Central Repository, which contains most of the open source libraries like JUnit. But this doesn't seem to work in your setup. The attempt to download JUnit fails and your are getting this error.

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

STS 3.7 issue for maven compile plugin

Today i downloaded STS version 3.7.2 for 64 bit machine. In that i import my maven project and i get below error
Description Resource Path Location Type
CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-plugin-api:jar:2.0.9, org.apache.maven:maven-artifact:jar:2.0.9, org.apache.maven:maven-core:jar:2.0.9, org.apache.maven:maven-settings:jar:2.0.9, org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9, org.apache.maven:maven-profile:jar:2.0.9, org.apache.maven:maven-model:jar:2.0.9, org.apache.maven:maven-repository-metadata:jar:2.0.9, org.apache.maven:maven-error-diagnostics:jar:2.0.9, org.apache.maven:maven-project:jar:2.0.9, org.apache.maven:maven-plugin-registry:jar:2.0.9, org.apache.maven:maven-plugin-descriptor:jar:2.0.9, org.apache.maven:maven-artifact-manager:jar:2.0.9, org.apache.maven:maven-monitor:jar:2.0.9, org.apache.maven:maven-toolchain:jar:1.0, org.codehaus.plexus:plexus-container-default:jar:1.5.5, org.codehaus.plexus:plexus-classworlds:jar:2.2.2: Failure to transfer org.apache.maven:maven-plugin-api:jar:2.0.9 from https://repo.maven.apache.org/maven2 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.apache.maven:maven-plugin-api:jar:2.0.9 from/to central
Any idea why this error
Seems very similar with this one. As suggested in the answer of the linked question try the -U switch.
Of course assuming that STS has properly configured Maven (either the build one or the one configured in your machine).

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/

Could not transfer artifact maven-compiler-plugin from central

I have just downloaded Eclipse Indigo and the m2e plugin, and this error shows up in the pom.xml of my project :
ArtifactResolutionException:
Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2
from http://repo1.maven.org/maven2 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.apache.maven.plugins:
maven-compiler-plugin:pom:2.3.2 from/to central (http://repo1.maven.org/maven2):
null to http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom
I find the original error message to be weird with the null.
I checked that last url and there is indeed a pom file there.
I have tried specifying a mirror in my settings.xml but it doesn't seem to look there anyway, apparently.
Also, when I type mvn clean I get a BUILD SUCCESSFUL message. How come ?
Thank you for helping me out.
Failure to get the POM for a dependency is not considered an error. It is just a warning. This explains why mvn clean is successful. As far as your settings not being consulted have you ensured that you have configured M2E to use your settings file?

Teamcity: Update local maven repository on build server from Nexus

I am using Teamcity to build by Maven based Java Project.
I have recently added a third party artifact into my Nexus Repository Manager. Now when I am building the project, I am getting the following error:
[core:project1] Failed to execute goal on project project1: Could not resolve dependencies for project core:project1:jar:1.0.0: Failure to find com.oracle:ojdbc:jar:11.2.0.2.0 in http://localhost:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced
Can anyone tell me how can i FORCE updates in the local repository cache on my build server? Is this something to do with Maven settings.xml ?
Try running maven with with the -U option.
http://www.sonatype.com/books/mvnref-book/reference/running.html#running-sect-deps-option
I think, that your real trouble was that the public group (nexus)
wasn't aggregating artifacts from third party.
The solution was to add a repository for third party artifacts to
settings.xml or to make a different group that will also provide
yours third party artifacts.

Resources