mvn install Error: Failed to read artifact descriptor org.apache.maven.plugins:maven-install-plugin:jar:2

I have been using my laptop for development. Today, I improved the desktop environment. I pulled the project from Git, and there was an error in Maven project install.
 

[INFO] Scanning for projects...
[INFO] Downloading from nexus: http://maven.aliyun.com/nexus/content/groups/public/com/bonc/ti/ti-parent/1.0.6-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata com.bonc.ti:ti-parent:1.0.6-SNAPSHOT/maven-metadata.xml from/to nexus (http://maven.aliyun.com/nexus/content/groups/public/): Operation not supported: connect
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building vbap data model 3.0.7-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading from nexus: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-install-plugin/2.5.2/maven-install-plugin-2.5.2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.307 s
[INFO] Finished at: 2017-12-19T19:50:31+08:00
[INFO] Final Memory: 15M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-install-plugin:2.5.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.5.2: Could not transfer artifact org.apache.maven.plugins:maven-install-plugin:pom:2.5.2 from/to nexus (http://maven.aliyun.com/nexus/content/groups/public/): Operation not supported: connect -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

The maven-install-Plugin :2.5.2 shows that it is not possible to transfer the Maven-install-plugin from the repository, because When Maven installs, it is done through the Maven-install-Plugin. The existence of the install plugin must be ensured first. Visit http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException you can see the cause of abnormal PluginResolutionException this has six:
 
 
 
1. Trying to access a plug-in that doesn't exist in the repository, such as miswriting the Group ID, artifact ID, or version number.
2. The accessed plug-in is a third-party plug-in not published to the central library, but your pom file or setting.xml file does not have < pluginRepository> The tag indicates the plug-in to be downloaded from the repository. One thing to note here is that < repository> definition does not work when finding plug-ins and their dependencies, only < pluginRepository> works for the plug-in download.
3. The plug-in repository needs permission authentication, but Maven does not have permission authentication, so it cannot access the repository server, so it should go to < server> definition:

<server>
  <!-- server(服务器)的id,对应着mirrors中的id,指定了该地址的验证信息 -->
  <id>nexus</id>
  <username>xxx</username>
  <password>xxx</password>
</server>

4. Network problems, such as some addresses need VPN to access, then need proxy configuration, etc. Settings. XML file to set the agent:
 

<proxies>
 <proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>http</protocol>
  <host>代理的ip地址</host>
  <port>端口</port>
 </proxy>
</proxies>

Maven failed to save the plug-in locally. According to LocalRepositoryNotAccessibleException for more information.
6. The configured plug-in repository is not visible to the plug-in you need. For example, if I want to access a SNAPSHOT version of the plug-in, I cannot access it in the official repository.
 
 
 

<pluginRepositories>
  <pluginRepository>
    <id>central</id>
    <url>http://central</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>true</enabled>
    </snapshots>
  </pluginRepository>
</pluginRepositories>

 
Going back to my own problem, I went to the warehouse and saw that again this version of the plug-in exists, so there is no 1 problem. It's not a 2.
Error: Operation not supported: connect. Look not to understand.
It is ok to say that there is a connection problem and That I can download other dependency package instructions. Then I went to the settings. XML file for configuration items, and I was fine.
Here are some solutions to this problem on StackOverflow:

1. Right click project -& GT; maven -> update-project -> Check force to Update Snapshot/Release -> OK
2. Delete all the files under. M2/and download them again.
3. Copy the Settings. XML file to.m2/ folder.
4. Check the Settings file configuration in Eclipse :Windows-& GT; preferences-> maven-> User Settings

Back in Eclipse, I right-click the project Update Project and found that it did not work. Then I copied the Settings.xml file to. M2/folder, ran MVN install and still reported an error.
I hope the above scheme can help you, thank you!
Reference link:
http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
https://stackoverflow.com/questions/18728792/failed-to-read-artifact-descriptor-for-artifact-present-in-my-localhost-nexus-re
https://stackoverflow.com/questions/10729394/artifactdescriptorexception-failed-to-read-artifact-descriptor-maven-error
If you have any related questions, please refer to:
https://stackoverflow.com/questions/12533885/could-not-calculate-build-plan-plugin-org-apache-maven-pluginsmaven-resources
https://stackoverflow.com/questions/6642146/maven-failed-to-read-artifact-descriptor
 
 
 

Read More: