创建maven项目时报错

错误代码
Could not resolve archetype  org.apache.maven.archetypes:maven-archetype-webapp:1.0  from any of the configured repositories.
Could not resolve artifact  org.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 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-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 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-webapp:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org


解决办法
先在CMD中执行mvn help:system命令行,执行后会下载很多东西,等待下载结束。
命令行执行:mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false?


参考地址 https://www.cnblogs.com/rever/p/7076596.html

你可能感兴趣的:(创建maven项目时报错)