Could not transfer artifact maven-compiler-plugin from central - maven

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?

Related

Why pom.xml showing error in Spring Starter Project

I m new to Spring Boot.
I have created couple of Spring Starter project for learning.
In my new project I am facing error in pom.xml for line -
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd
Error is -
Failure to transfer net.bytebuddy:byte-buddy:jar:1.10.11 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 net.bytebuddy:byte-buddy:jar:1.10.11 from/to central (https://
repo.maven.apache.org/maven2): The operation was cancelled. org.eclipse.aether.transfer.ArtifactTransferException: Failure to transfer net.bytebuddy:byte-buddy:jar:1.10.11
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 net.bytebuddy:byte-buddy:jar:1.10.11 from/to central (https://repo.maven.apache.org/maven2): The operation was
cancelled. at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:225) at
org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:193) at
org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:559) at
org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:483) at
org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:401) at
org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:229) at
org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:340) at
org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:202) at
org.apache.maven.project.DefaultProjectBuilder.resolveDependencies(DefaultProjectBuilder.java:227) at
org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:200) at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:124)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.readMavenProject(MavenImpl.java:629) at
org.eclipse.m2e.core.internal.project.registry.DefaultMavenDependencyResolver.resolveProjectDependencies(DefaultMavenDependencyResolver.java:65) at
org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refreshPhase2(ProjectRegistryManager.java:547) at
org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.lambda$3(ProjectRegistryManager.java:511) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) at
org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:509) at
org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:361) at
org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:312) at
org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.getProjectFacade(MavenBuilder.java:151) at
org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.lambda$0(MavenBuilder.java:89) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) at
org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:88) at
org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:197) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:832) at
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220) at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:316) at
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:319) at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:371) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:392) at
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:154) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244) at
org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
I have already checked some questions here -
My project's pom.xml error
My project's pom.xml error
But none of these resolved error.
Could you please help me on this
Basically, Your imports are corrupted most probably due to some internet connectivity issues. So if your ide gives you Invalidate Cache and Restart option you can try that.
Best Way is to execute this command from project terminal command line - mvn clean install -U
Or you can Delete the related artifacts (or the full local repo) from ~.m2\repository by hand.
Go to ~/.m2/repository and delete that net/bytebuddy/byte-buddy folder. Maven is sensitive with such thing when you maybe have trouble downloading the jar, and the consequent run it is cached.
Or you can try to run maven with -U parameter to force update.

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

How to force Jenkins' Maven to update Maven dependencies after they had been cached with errors

I'm having a problem where I tried to run a Maven job on Jenkins, but during the execution, the firewall was blocking access to the mvn repositories; this caused an error when Maven was updating the dependencies, and it cached those errors.
Now, even after the firewall issue was resolved, the job keeps displaying this error:
[FATAL] Non-resolvable parent POM: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.0.2.RELEASE from http://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.springframework.boot:spring-boot-starter-parent:pom:2.0.2.RELEASE from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org: unknown error and 'parent.relativePath' points at no local POM # line 14, column 10
I do know that if I was using the command line, it would be possible to use mvn clean install -U to force the update, but how would I do that on Jenkins?
As per Jens' suggestion, adding -U to the to the goals/options field solves the issue.

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).

Error while importing Maven Project into Eclipse

if i Give resolve later and go into the eclipse i get the error in the Pom.xml
Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from http://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.plugins:maven-resources-plugin:pom:2.5
from/to central (http://repo.maven.apache.org/maven2): null to http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom
Go to your local .m2 folder (c:\users\.m2), select the directory org\apache\maven\plugins\maven-resources-plugin, delete it.
Then use in eclipse <project-root>\maven\Update Project...
Sometimes Maven fails to download the dependencies properly.
You can right click on the project, and select Maven->Update Project. Then make sure the Force Update of Snapshot/Releases check box is selected and press OK.

Resources