Fix issues with creating MAVEN Web project times could not resolve archetype with eclipse

Source: Internet
Author: User

The first two days of reloading the system, today to write a project, there are some problems.

When you created a MAVEN Web project using Eclipse, you reported the issue of could not resolve archetype after the point was finished.

Could not resolve archetypeorg.apache.maven.archetypes:maven-archetype-webapp:1.0From any of the configured repositories.
Could not resolve artifactorg.apache.maven.archetypes:maven-archetype-webapp:pom:1.0
Failure to transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from https://repo.maven.apache.org/ Maven2 was cached in the local repository, resolution would not be reattempted until the update interval of central have ELA Psed or updates are forced. Original error:could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to Central (HTTPS://REPO.MAVEN.APACHE.ORG/MAVEN2): repo.maven.apache.org
Failure to transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from https://repo.maven.apache.org/ Maven2 was cached in the local repository, resolution would not be reattempted until the update interval of central have ELA Psed or updates are forced. Original error:could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to Central (HTTPS://REPO.MAVEN.APACHE.ORG/MAVEN2): repo.maven.apache.org

There are two types of solutions that are more popular online:

1. Add a new catalog configuration in the Eclipse MAVEN configuration

2. load the Maven-archetype-quickstart in the local library

I used method 1 first, and there was no effect after the configuration. Using Method 2 again, after configuring a project to create a Maven-archetype-quickstart type, the MAVEN Web project still has an error.

Then I thought of the analysis of the error content to solve the problem.

Look at the first sentence of the error, the general meaning is: Unable to parse org.apache.maven.archetypes:maven-archetype-webapp:1.0 from any of the configured libraries .

So the second approach doesn't work because of the lack of webapp, and the only maven-archetype-quickstart that we've installed from the second step is the project package.

Look at the second paragraph of the first sentence: Download org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from Https://repo.maven.apache.org/maven2 failed.

You can tell from here that the problem is org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 this package was not found by Maven when creating the MAVEN Web project. Or it was found, but there was no way to parse it. MAVEN cannot be downloaded from a remote repository when it cannot be found or cannot be resolved.

So here's my solution:

    1. Load maven-archetype-webapp in the local library
    2. Remove the maven-archetype-webapp This package from the current local repository and create the project so that Maven gets the package automatically from the remote repository.

Note: The path to the package is (% your default local warehouse%\repository\org\apache\maven\archetypes\maven-archetype-webapp\1.0)

The idea of Method 2 comes from the MAVEN download jar package to the local repository that produces a. lastupdate file that causes the package to be unusable.

A good way to add:

Execute the MVN help:system command line in cmd First, and download a lot of things after execution, waiting for the download to finish.

Command line execution: MVN archetype:generate-dgroupid={project-packaging}-dartifactid={project-name}-darchetypeartifactid= Maven-archetype-webapp-dinteractivemode=false?

The required project jar package is downloaded and you are ready to create the project after the download is complete.

Fix issues with creating MAVEN Web project times could not resolve archetype with eclipse

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.