Some problems encountered in the initial use of maven - package missing error reported by pom.xml when creating a new maven project

         In fact, I am not new to maven, but when I configured it before, because many things were prepared by others, there were not so many problems. This is the first time I have configured it on my own computer. I have just created a maven project and still When nothing is done, an error is reported in pom.xml, the mouse is moved to the red cross, and the error is as follows:

1.Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:jar:2.10 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-surefire-plugin:jar:2.10 

 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000

 

     It means that the maven-surefire-plugin:jar package was not found in the maven repository, the plugin was not downloaded, and the maven local library was opened...\repository\org\apache\maven\plugins\maven-surefire -plugin\2.10 will find: there is only one maven-surefire-plugin-2.10.pom.lastUpdated, but no maven-surefire-plugin-2.10.jar

Solution: 

1. Delete the maven-surefire-plugin-2.7.1.pom.lastUpdated file

 

2. Right click on project -> Maven - Update MAVEN Project

When updating, check the Force Update of Snapshot/Releases. 

     Well, this problem is gone, but then there is another one:

2.Failure to transfer org.apache.maven:maven-settings:pom:2.0.6 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:maven-settings:pom:2.0.6 from/to central (http://

 repo.maven.apache.org/maven2): No response received after 60000

     Then go to the local warehouse ...\repository\org\apache\maven-settings\2.0.0.6, delete the jar package ending with sha1, and update the maven project.

    Similarly, if you encounter problems such as the lack of jar packages or plug-ins in the warehouse, you can solve them in this way. However, if there is no jar package in the warehouse, you need to download the jar package elsewhere. You can download it from Alibaba Cloud.

 

Also, when manually configuring the compilation plugin in pom.xml, report:

3.Error resolving version for plugin 'org.apache.maven.plugins:maven-compile-plugin' from the repositories [local (C:\Users\liuli

 \.m2\repository), central (http://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository

 

After checking for a long time, I also found a lot of methods on the Internet, and finally found that the artifactId was written as maven-compile-plugin, oh, it is really a careless waste of energy. Hope you guys are more careful.

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326012722&siteId=291194637