Problems when you create a new MAVEN Web project

Source: Internet
Author: User

Suddenly want to learn maven, did not expect to build the process of the project, went through the various pits ...

Initially, MAVEN project was built, and simple project was checked.

Very smooth without any problems, project structure is like this

Looks too simple, so after a query, start a further attempt to select the QuickStart template

Error: Missing artifact junit:junit:jar:4.5

FIX: Window--priferences--myeclipse--maven, set Offline to not select, just click the space in Pom.xml and then save it, it can download the jar file automatically.

Then I tried the webapp template, and there were a lot of problems.

First in the lower right corner has been loading retrieving archetypes, resulting in special cards, the last error, an internal error occurred during: "Retrieving Archetypes:". GC overhead limit exceeded, probably means memory overflow, see the task Manager in the loading time unexpectedly reached more than 1000 trillion, check data are scattered, tangled all day.

One is to modify the Myeclipse.ini file, and my modifications are as follows:

-XMS:JVM initially allocated memory is 1/64 of the physical memory by default

-XMX:JVM Maximum allocated memory defaults to 1/4 of physical memory

-XX: Maximum non-heap memory size, default is 1/4 of physical memory

See a master summary of the main methods to optimize MyEclipse speed:

1. Modify the Myeclipse.ini.
2. Cancel Automatic validation
3. Tick off the useless plugin.
4. Modify the boot loader module

But the above approach doesn't change my problem.

Then I tried the plugin without myeclipse.

Solution: Window--priferences--myeclipse--maven--archetypes

Select Add Remote catalog,catalog file to fill in: Http://repo1.maven.org/maven2/archetype-catalog.xml

or download Archetype-catalog.xml to local, choose Add Local Catalog, fill in the path, faster than the internet ... then click Apply->ok.

Then choose the new catalog we created

Just touch maven a lot of things are know its why, but one thing is conf directory of Setting.xml file is very important, inside set the central library location, the default is under C:\Users\xxx\.m2\repository, But can be modified according to their own needs, and in the Window-preferences-myeclipse-maven4myeclipse-user setting inside the local repository and the location of the configuration file consistent

In addition to the agent, mirroring, when downloading the jar file is often slow, because the visit to foreign sites, you can make the following changes in the image

<mirror>

<id>CN</id>
<name>oschina central</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<mirrorOf>central</mirrorOf>

</mirror>

There are a bunch of methods, but in my case it does not play a big role, change the work space is also so, all roads to Rome, this time directly build Web project, and choose Add maven

To report such a mistake,

Description Resource Path Location Type
Failure to transfer com.thoughtworks.xstream:xstream:pom:1.3.1 from Http://repo.maven.apache.org/maven2 is cached in The local repository, resolution is not being reattempted until the update interval of the central have elapsed or updates are F orced. Original error:could not transfer artifact com.thoughtworks.xstream:xstream:pom:1.3.1 from/to Central (HTTP// REPO.MAVEN.APACHE.ORG/MAVEN2): The operation was cancelled.pom.xml/testline 1Maven Configuration problem

Until now it has not been resolved, but the accident is that this error does not affect the operation (hopefully someone can tell me what's going on, a red fork, forcing the obsessive-compulsive disorder AH)

Test, add the following code to the Pom.xml file,

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>

In the lower right corner, you can see that the corresponding jar is being downloaded into our library.

—————————————————————————————

—————————————————————————————

As inexperienced novice, there is no way to help answer the great God, can only step a hole to go ...

The next step is to look at the integration of MAVEN with some mainstream frameworks ...

Hang Hang pit ...

Problems when you create a new MAVEN Web project

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.