在使用Eclipse创建Java Maven项目的时候,报错如下:
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:1.1 from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-quickstart:jar:1.1
Failure to transfer org.apache.maven.archetypes:maven-archetype-quickstart:jar:1.1 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-quickstart:jar:1.1 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org
Failure to transfer org.apache.maven.archetypes:maven-archetype-quickstart:jar:1.1 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-quickstart:jar:1.1 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org
Window > Preferences –Maven
Catalog File: http://repo1.maven.org/maven2/archetype-catalog.xml Description: maven catalog
解决之后,就可以新建Maven Project了。
File –New —- Maven Project
每一个骨架都会建相应的目录结构和一些通用文件,最常用的是maven-archetype-quickstart和maven-archetype-webapp骨架。