Maven builds the project too slow solution, and the error Retrievingarchetypes:hasencounteredaproblem

If the error message is as follows:

Retrieving archetypes:' has encountered a problem
An internal error occurred during:"Retrieving archetypes

details:
An internal error occurred during: "Retrievingarchetypes:".
Java heap space




reason:

ApacheMaven is a very popular project building and management tool today. It liberates developers from complex project dependency processing transactions and fully automates the management of dependency issues. In the process of web application development, we usually use maven's archetype plug-in to generate the project framework. When building the project skeleton with maven, the speed is very slow, whether it is used directly in the command line or in the IDE.

To understand why, you need to know how maven works. During the construction process, we just provided maven with some information such as groupId, artifactId, archetypeArtifactId, etc. How does maven build the entire project with only this information? Where does its knowledge come from? the answer is:

 

[html]  viewplain copy  
  1. http://repo1.maven.org/maven2/archetype-catalog.xml  
It is recorded here that all archetype build information, maven will remotely access the page when building the project skeleton through the archetype plugin, which can be proved by the -X parameter of maven.

solution:

1. View the source code of the http://repo1.maven.org/maven2/archetype-catalog.xml page through a browser, copy it to the local, name it archetype-catalog.xml

2. Add to myEclipse, as shown in the figure


final effect



Introducing Alibaba Cloud Mirror

 
     <mirror>
        <id>nexus-aliyun</id>
        <mirrorOf>*</mirrorOf>
        <name>Nexus aliyun</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public</url>
        </mirror>
 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326912510&siteId=291194637