Reputation: 644
When I am trying to create new project on Maven in eclipse IDE ,It shows the following errors:
"Could not get the value for parameter encoding for plugin execution default-resources Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.5 ()"
Anyone please tell what I have to do?
can anyone tell me the steps to create Spring project with Maven enabled?
POM.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.spring</groupId>
<artifactId>SpringMaven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>SpringMaven</name>
</project>
Upvotes: 12
Views: 51136
Reputation: 1727
The following steps worked for me:
These steps worked for me. If this works for you make sure to upvote, otherwise drop a comment.
Upvotes: 46
Reputation: 1
Upvotes: 0
Reputation: 64205
I had similar issue. Below is my detailed error message:
Could not get the value for parameter encoding for plugin execution default-resources Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 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.6, org.apache.maven:maven-project:jar:2.0.6, org.apache.maven:maven-profile:jar:2.0.6, org.apache.maven:maven-artifact-manager:jar:2.0.6, org.apache.maven:maven-plugin-registry:jar:2.0.6, org.apache.maven:maven-core:jar:2.0.6, org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.6, org.apache.maven:maven-repository-metadata:jar:2.0.6, org.apache.maven:maven-error-diagnostics:jar:2.0.6, org.apache.maven:maven-plugin-descriptor:jar:2.0.6, classworlds:classworlds:jar:1.1, org.apache.maven:maven-artifact:jar:2.0.6, org.apache.maven:maven-settings:jar:2.0.6, org.apache.maven:maven-model:jar:2.0.6, org.apache.maven:maven-monitor:jar:2.0.6: Failure to transfer org.apache.maven:maven-plugin-api:jar:2.0.6 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.6 from/to central (https://repo.maven.apache.org/maven2): connect timed out
From the first look, it seems the connection to the central repository failed. But actually it turns out something is f**ked up in my local repository
.
Rather than spend time to figuring out what's wrong with my 10G
local repository, I use an empty folder as the new local repository.
And error is gone.
This is not a solution. This is just a workaround.
I think maven is not robust enough when local repository gets big. And the misleading error message has wasted me a lot of time to check network or proxy issue. Hope it can save other souls some time.
BTW: Apache Maven Cookbook 2015 is a very good book for Maven starters.
The chosen answer did essentially similar things to mine.
Upvotes: 1
Reputation: 3183
Delete maven resource plugin jars (delete the whole folder) from this location - {user.home}.m2\repository\org\apache\maven\plugins\maven-resources-plugin and then try to rebuild again.
Upvotes: 2