Error creating new Maven project in Eclipse

When I try to create a new project on Maven in the eclipse IDE, it shows the following errors:

"Failed to get value for parameter encoding for execution of default plugins. Plug-in org.apache.maven.plugins: maven-resources-plugin: 2.5 or one of its dependencies could not be solved: could not collect dependencies for org.apache.maven. plugins: maven-resources-plugin: jar: 2.5 () "

Someone say what should I do?

can anyone tell me the steps to create a 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> 
+7
source share
4 answers

The following steps helped me:

  1. Close Eclipse.
  2. Go to the user's home directory. (For example: "C: \ Users \ YourUserName \ .m2")
  3. Delete the vault folder.
  4. Open Eclipse again.
  5. Click on the Maven project that has the problem and go to "Project" → "Clear."
  6. Right-click on the project and go to "Maven" → "Update Project ...".
  7. Close Eclipse.
  8. Open the Eclipse.
  9. Click on the project folder in the "Project Explorer" window (usually on the left).
  10. Press the F5 key several times to update the project.
  11. Done!

These steps helped me. If this works for you, be sure to vote, otherwise leave a comment.

+26
source

Remove the maven resource plugin banners from this place (delete the entire folder) - {user.home} .m2 \ repository \ org \ apache \ maven \ plugins \ maven-resources-plugin, and then try to restore again.

+2
source

I had a similar problem. The following is a detailed error message:

Failed to get value for parameter encoding for plugin execution. Default plugin-resources org.apache.maven.plugins: maven-resources-plugin: 2.6 or one of its dependencies could not be solved: 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: bank: 2.0.6, org.apache.maven: Maven-plugin-registry: jar: 2.0.6, org.apache.maven: Maven-core: bank: 2.0.6, org.apache .maven: Maven-plugin-parameter-Archivist: bank: 2.0.6, org.apache.maven: Maven-storage-metadata: jar: 2.0.6, org.apache.maven: Maven error diagnostics: jar: 2.0.6, org.apache.maven: Maven-plugin descriptor: bank: 2.0.6, classworlds: classworlds: bank: 1,1, org.apache.maven: Maven-artifact: jar: 2.0 .6, org.apache.maven: Maven-configuration: jar: 2.0.6, org.apache.maven: Maven-model: jar: 2.0.6, org.apache.maven: maven-monitor: jar: 2.0.6 : Failure to comply with org.apache.maven: maven-plugin-api: jar: 2.0.6 from https://repo.maven.apache.org/maven2 was cached in the local repository, the permission will not be reloaded until the central interval expires or update is forced. Original error: Failed to transfer artifact org.apache.maven: maven-plugin-api: jar: 2.0.6 from / to central ( https://repo.maven.apache.org/maven2 ): connection timeout

At first glance, it seems that the connection to the central repository failed. But actually it turns out something in my local repository .

Instead of wasting time figuring out what is wrong with my local 10G repository, I use an empty folder as the new local repository.

And the error has disappeared.

This is not a solution. This is just a workaround.

I think maven is not stable enough when the local repository gets big. And the misleading error message spent a lot of time checking the problem with the network or proxy. Hope this can save other souls for a while.

BTW: Apache Maven Cookbook 2015 is a very good Maven starter book.

ADD 1

The answer you choose is essentially similar to mine.

0
source
  • close eclipse, delete the .m2 folder
  • go to https://repo.maven.apache.org/maven2 "and download the certificate and install the certificate using" keytool "for more detailed use of google it.
  • open eclipse and update your existing maven project.
  • Now try to create a maven project, now everything should be fine.
0
source

Source: https://habr.com/ru/post/975128/


All Articles