"Turn" idea using maven skeleton to build project slow problem

Source: Internet
Author: User

Transferred from: http://9leg.com/maven/2015/02/01/why-is-mvn-archetype-generate-so-low.html

Recently switched from the community version of IntelliJ idea 14 to Ultimate.

Problem arises

The most recent switch from the community version of IntelliJ idea 14 to Ultimate,key was downloaded from the network. After installation, when you create Maven project (using archetype), it's incredibly slow, and from the idea's console you can see that the information stays in:

[INFO]<<<Maven-Archetype-Plugin2.2:Generate(Default-Cli)<Generate-Sources@Standalone-pom <<<[INFO ][info] --- Maven-archetype-plugin:2.2< Span class= "o" >:generate  (default- cli) @ standalone- pom ---[info span class= "n" >generating project in batch mode   


Retries many times, all in the generating project in Batch mode waits, but the idea of the status bar display is still running, and did not die, about 30 minutes later to complete the creation of the project.

Problem analysis

Why do you wait so long? I tried it first with MVN's original order,

 mvn archetype: generate -dgroupid=com 9leg. App -dartifactid=my- app -darchetypeartifactid=maven -archetype-quickstart - dinteractivemode=false         

or generating project in Batch mode has been waiting a long time, but it excludes the question of idea. then add   -X   command to display debuginfo.

mvn -X archetype:generate -DgroupId=com.9leg.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

The output information is as follows:

[INFO] Generating project in Batch mode[DEBUG] Searching for remote catalog: http://repo1.maven.org/maven2/archetype-catalog.xml

It appears that the Catalog.xml file on the network is being requested, which results in a slow speed. Directly copied the URL opened with a browser, the speed is super slow, wait a long time to open. It appears that the problem is here.

It appears that the Catalog.xml file on the network is being requested, which results in a slow speed. Directly copied the URL opened with a browser, the speed is super slow, wait a long time to open. It appears that the problem is here.

Problem solving
    1. Download the Archetype-catalog.xml file directly and place it in the local Apache-maven directory.
    2. When using the MVN archetype:generate command, add -darchetypecatalog=localto replace the catalog.xml on the network.

Okay, OK!!! Also can be happy to set up MAVEN Project!!! Tears ran for a long time!!!

Off Topic

I switched to eclipse, generated a MAVEN project and chose skeleton archetype, without any problems. In Eclipse, you can set up Maven's archetype catalog, either locally or remotely. Switching to idea, looking for half a day, searching for half a day, does not seem to have this setting. You can only set the custom archetype individually when you create the project, and you cannot set the entire archetype list. Who knows please inform, thank you.

Reference: ARCHETYPE-202

"Turn" idea using maven skeleton to build project slow problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.