分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 代码编程

使用maven创建工程报错Could not resolve archetype org.apache.maven.archetype

发布时间:2023-09-06 01:27责任编辑:赖小花关键词:apache

错误:

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:pom:1.1



解决思路:在本地库中装载maven-archetype-quickstart-1.1.jar
第1步.从  http://maven.ibiblio.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/maven-archetype-quickstart-1.1.jar

下载最新版maven-archetype-quickstart-1.1.jar

第2步.cmd窗口执行

mvn install:install-file -DgroupId=org.apache.maven.archetypes -DartifactId=maven-archetype-quickstart -Dversion=1.1 -Dpackaging=jar -Dfile=d:\maven-archetype-webapp-1.0.jar

红字是你jar包放在的位置

追加说明:

按照以上步骤仍然还不行,查明了原因。maven配置的镜像库是oschina的,貌似关闭了。后来改用阿里的就可以了。附上MAVEN依赖的比较全的镜像库地址:

 ????<!--指定阿里云仓库--> ???<mirror> ?????<id>alimaven</id> ?????<name>aliyun maven</name> ?????<url>http://maven.aliyun.com/nexus/content/groups/public/</url> ?????<mirrorOf>central</mirrorOf> ???????????</mirror> ???<mirror> ???????<id>central</id> ???????<name>Maven Repository Switchboard</name> ???????<url>http://repo1.maven.org/maven2/</url> ???????<mirrorOf>central</mirrorOf> ???</mirror> ???<mirror> ???????<id>repo2</id> ???????<mirrorOf>central</mirrorOf> ???????<name>Human Readable Name for this Mirror.</name> ???????<url>http://repo2.maven.org/maven2/</url> ???</mirror> ???<mirror> ???????<id>ibiblio</id> ???????<mirrorOf>central</mirrorOf> ???????<name>Human Readable Name for this Mirror.</name> ???????<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url> ???</mirror> ???<mirror> ???????<id>jboss-public-repository-group</id> ???????<mirrorOf>central</mirrorOf> ???????<name>JBoss Public Repository Group</name> ???????<url>http://repository.jboss.org/nexus/content/groups/public</url> ???</mirror> ???<!-- 中央仓库在中国的镜像 --> ???<mirror> ???????<id>maven.net.cn</id> ???????<name>oneof the central mirrors in china</name> ???????<url>http://maven.net.cn/content/groups/public/</url> ???????<mirrorOf>central</mirrorOf> ???</mirror>

使用maven创建工程报错Could not resolve archetype org.apache.maven.archetype

原文地址:http://www.cnblogs.com/30go/p/7895455.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved