Maven Could not transfer artifact junit:junit:jar:3.8.1 - maven

My software version:
Eclipse for Java Developers: http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/indigosr2
SVN Plugin: http://subclipse.tigris.org/update_1.8.x
The exception message:
Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failure to transfer junit:junit:jar:3.8.1 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 junit:junit:jar:3.8.1 from/to central (http://repo1.maven.org/maven2)**: The operation was cancelled. (org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources:default-resources:process-resources)
But the junit:junit:jar:3.8.1 can be found through the following link:
http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22junit%22%20AND%20a%3A%22junit%22%20AND%20v%3A%223.8.1%22
There isn't any HTTP proxy.
How can I resolve the problem? Any suggestion is welcome!

Related

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

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

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.

spring tool suite : missing dependencies after upgrading to spring boot 1.4.0

I have upgraded spring boot version from 1.3.2 to 1.4.0 to be able to use #MockBean annotation to mock my beans in unit testing, but since I still have "The import cannot be resolved to a type compilation" error allover my projects, however I have updated the maven project dependencies from eclipse and deleted the repository folder from the file system and allowed maven to re download it but in vain.
btw, I can clean and install the project from command line maven command "mvn clean install".
Any ideas please?
Edit
I have changed spring cloud dependency version from Brixton.BUILD-SNAPSHOT to Brixton.SR5 and this solves the problem with the cloud imports and #EnableDiscoveryClient annotation, but I still have problems with the dependency
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
I have the following errors
1-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: Failed to collect dependencies at org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 -> org.apache.maven.shared:maven-shared-incremental:jar:1.1 -> org.apache.maven:maven-core:jar:2.2.1 -> org.apache.maven:maven-repository-metadata:jar:2.2.1: ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven:maven-repository-metadata:jar:2.2.1: ArtifactResolutionException: Failure to transfer org.apache.maven:maven-repository-metadata:pom:2.2.1 from https://repo.maven.apache.org/maven2 was cached in the local 1-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-repository-metadata:pom:2.2.1 from/to central (https://repo.maven.apache.org/maven2): timeout
2-Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (execution: default-compile, phase: compile)
Failure to transfer org.springframework.boot:spring-boot-starter-data-jpa:jar:1.4.0.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-data-jpa:jar:1.4.0.RELEASE from/to central (https://repo.maven.apache.org/maven2): timeout
3-org.eclipse.aether.transfer.ArtifactTransferException: Failure to transfer org.springframework.boot:spring-boot-starter-data-jpa:jar:1.4.0.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-data-jpa:jar:1.4.0.RELEASE from/to central (https://repo.maven.apache.org/maven2): timeout
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:238)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:585)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:503)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:367)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:205)
at org.apache.maven.project.DefaultProjectBuilder.resolveDependencies(DefaultProjectBuilder.java:215)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:188)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:119)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.readMavenProject(MavenImpl.java:636)
at org.eclipse.m2e.core.internal.project.registry.DefaultMavenDependencyResolver.resolveProjectDependencies(DefaultMavenDependencyResolver.java:63)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refreshPhase2(ProjectRegistryManager.java:529)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager$3.call(ProjectRegistryManager.java:491)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager$3.call(ProjectRegistryManager.java:1)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:495)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:350)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:297)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration0(ProjectConfigurationManager.java:398)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$2.call(ProjectConfigurationManager.java:345)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$2.call(ProjectConfigurationManager.java:1)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1351)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:342)
at org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob.runInWorkspace(UpdateMavenProjectJob.java:77)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
The error messages seem to indicate that it's a timeout problem, however all other jars and dependencies are downloaded , my internet connection is very good and I have manged to build from maven command line without compile errors.
Just based on a personal experience :)
I have a parent maven project with pom file contains the common dependencies and properties and so on...by explicitly changing anything in this file(even if a dummy thing) and save eclipse has rebuild the workspace and all compiler errors in markers are gone away.

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

How to solve these Maven Errors: classpath error: unable to find.., ArtifactDescriptorException: Failed to read artifact descriptor for

I tried to use Springsource Tool Suite (STS) but I had so many compile errors.
classpath error: unable to find org.aspectj.lang.JoinPoint (check that aspectjrt.jar is in your classpath) SpringApp Unknown Java Problem
ArtifactDescriptorException: Failed to read artifact descriptor for cglib:cglib-nodep:jar:2.2: ArtifactResolutionException: Failure to transfer cglib:cglib-nodep:pom:2.2 from http://maven.springframework.org/release was cached in the local repository, resolution will not be reattempted until the update interval of spring-maven-release has elapsed or updates are forced. Original error: Could not transfer artifact cglib:cglib-nodep:pom:2.2 from/to spring-maven-release (http://maven.springframework.org/release): null to http://maven.springframework.org/release/cglib/cglib-nodep/2.2/cglib-nodep-2.2.pom pom.xml /SpringApp line 1 Maven Dependency Problem
Failure to transfer org.codehaus.mojo:aspectj-maven-plugin:pom:1.2 from http://maven.springframework.org/release was cached in the local repository, resolution will not be reattempted until the update interval of spring-maven-release has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.mojo:aspectj-maven-plugin:pom:1.2 from/to spring-maven-release (http://maven.springframework.org/release): null to http://maven.springframework.org/release/org/codehaus/mojo/aspectj-maven-plugin/1.2/aspectj-maven-plugin-1.2.pom pom.xml /SpringApp line 1 Maven pom Loading Problem
I found so many question here in stackoverflow but no answers.
I just set the IDE's proxy settings plus the Maven's setings.xml proxy settings.

Resources