Creating Maven Project in Eclipse Neon2 encountred a issue : Could not resolve archetype - maven

I am trying to create a maven project. But it is throwing following Error.
"Could not resolve archetype
org.apache.maven.archetypes:maven-archetype-webapp:1.0 from any of the
configured repositories. Could not resolve artifact
org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 Failure to
transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0
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.archetypes:maven-archetype-webapp:pom:1.0 from/to
central (https://repo.maven.apache.org/maven2): connect timed out
Failure to transfer
org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 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.archetypes:maven-archetype-webapp:pom:1.0 from/to
central (https://repo.maven.apache.org/maven2): connect timed out"
Attached Image below.

I have the same problem before. I found the solution from this Maven error "Failure to transfer...", hope it can help you.
Anurak Th.

You can resolve this problem removing .m2 folder from C:\Users\{user name}\.m2. Then recreate your maven project and right click on your project > maven > update project.
Initially, maven looks for libraries and dependencies in the local repository. In case, they are not in its local repository it will look for the remote ones. But in this case, it didn't look for the remote repository. So need to update the project for future conditions.

Related

maven/pom build error due to SSL issue/corp Non-resolvable parent POM

I am facing below :
Project build error: Non-resolvable parent POM for XXXXXXXXXXXXXXXXX .Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.1.8.RELEASE 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.springframework.boot:spring-boot-starter-parent:pom:2.1.8.RELEASE from/to central (https://repo.maven.apache.org/maven2): proxy.example.com and 'parent.relativePath' points at no local POMJava(0)
I am on corp/work network, using visual studio code for a basic Springboot project.
How can I make it work?
What I tried?
used the working pom file for another project,It works as expected. (However this has corp internal repositories)
I also tried importing the ssl certs for this "https://repo.maven.apache.org/maven2", howevever i don't have permissions to do that, since I am using Enterprise machine.
Also I did try many other solutions(tweaking the pom) suggested here, but doesn't seem to work.

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.

How to fix “Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2?

I have tried all of the above solutions but still seeing this error.
I have installed maven 3.5.3 ,JDK1.7.0_67 and eclipse Version: Kepler Service Release 2 and have configured maven in eclipse IDE
But when creating a maven project i see the below mentioned error.
I tried resolving this
By updating the proxy setting in settings.xml file, but same error occurs.
By deleting the .m2 file and creating project again , but same error occurs.
By adding this maven-resources-plugin-2.5.jar external jar
None of the above methods worked for me
Could you please help me in resolving this as I am Stuck here.
Could not calculate build plan: Plugin
org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its
dependencies could not be resolved: Failure to transfer
org.apache.maven.plugins:maven-resources-plugin:jar: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:jar:2.5 from/to
central (http://repo.maven.apache.org/maven2): Failed to transfer
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.jar.
Error code 503, Service Unavailable Plugin
org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its
dependencies could not be resolved: Failure to transfer
org.apache.maven.plugins:maven-resources-plugin:jar: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:jar:2.5 from/to
central (http://repo.maven.apache.org/maven2): Failed to transfer
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.jar.
Error code 503, Service Unavailable

SpringBoot Maven Project Update not working

I am new to Spring Boot, and I am trying to work with sts-3.6.3SR1. Please find the attached file of the pom.xml file:
while i click update maven project, it's showing an error:
Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.18.1 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.plugins:maven-surefire-plugin:pom:2.18.1 from/to central
(https://repo.maven.apache.org/maven2): repo.maven.apache.org"
wow, i have opened the folder "C:\Users\kangkan pc.m2\repository\org\apache\maven\plugins\maven-surefire-pl‌​ugin\2.18.1 " and deleted the *.lastupdate file, then try Update Maven Project again.. And now its working fine .. anyways Thanks guys.

Maven build is not working for STS spring-tool-suite-3.7.2.RELEASE-e4.5.1-win32.zip

I just created a simple test maven quick start project in my Windows 7 PC.
getting
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: 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
(https://repo.maven.apache.org/maven2): connect timed out
I have mapped manual maven home from local machine thought embedded version has the problem
mvn clean install -U
This will make a clean install and update the dependencies

Resources