使用maven创建新项目出现Unable to determine the release version错误
2011-06-24 11:05
453 查看
当使用mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app来创建一个新项目时,有时候会出现以下错误:
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO]
----------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:create] (aggregator-style)
[INFO]
----------------------------------------------------------------------------
。。。。。。。
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [archetype:create]
[INFO] Defaulting package to group ID: com.mycompany.app
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
GroupId: org.apache.maven.archetypes
ArtifactId: maven-archetype-quickstart
Version: RELEASE
Reason: Unable to determine the release version
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.apache.maven.archetypes
-DartifactId=maven-arch
etype-quickstart /
-Dversion=RELEASE -Dpackaging=jar -Dfile=/path/to/file
org.apache.maven.archetypes:maven-archetype-quickstart:jar:RELEASE
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Tue Apr 17 07:08:50 MDT 2007
[INFO] Final Memory: 4M/8M
[INFO]
------------------------------------------------------------------------
请注意红色部分为错误产生的根本原因, 由于maven还处于开发过程中,开发方极有可能已经更新某个plug-in的版本,但本地plug-in 的metadata没有版本的信息或者没有最新版本的信息,致使maven无法下载正确的版本。同时请注意蓝色部分,这是提示的解决办法。具体步骤如下:
1.打开网址:http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/
2.选择最新版本并且下载最新的“maven-archetype-quickstart-1.0-alpha-4.jar ”文件
3.安装这个archetype到maven本地仓库。使用命令如下:mvn install:install-file -DgroupId=org.apache.maven.archtypes -Dar
tifactId=maven-archetype-quickstart -Dversion=1.0-alpha-4 -Dpackaging=jar -Dfile=c:/7000/maven/maven-archetype-quickstart-1.0-alpha-4.jar。注意-Dfile是刚下载的文件的路径。
现在在cmd中执行mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app就可以创建新项目了。
Feedback
# re: 使用maven创建新项目出现Unable to determine the release version错误 回复 更多评论
2008-04-09 09:41 by lizhh
请教一个问题:我安装了maven2.0.8版本,只有安装文件下的conf/settings.xml ,在网上看还有个用户级的settings.xml在用户目录下的.m2/settings.xml.我的.m2下怎么没有settings.xml?
# re: 使用maven创建新项目出现Unable to determine the release version错误 回复 更多评论
2008-04-10 17:06 by zjibo
.m2/settings.xml是选择默认安装目录才会有的。
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO]
----------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:create] (aggregator-style)
[INFO]
----------------------------------------------------------------------------
。。。。。。。
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [archetype:create]
[INFO] Defaulting package to group ID: com.mycompany.app
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
GroupId: org.apache.maven.archetypes
ArtifactId: maven-archetype-quickstart
Version: RELEASE
Reason: Unable to determine the release version
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.apache.maven.archetypes
-DartifactId=maven-arch
etype-quickstart /
-Dversion=RELEASE -Dpackaging=jar -Dfile=/path/to/file
org.apache.maven.archetypes:maven-archetype-quickstart:jar:RELEASE
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Tue Apr 17 07:08:50 MDT 2007
[INFO] Final Memory: 4M/8M
[INFO]
------------------------------------------------------------------------
请注意红色部分为错误产生的根本原因, 由于maven还处于开发过程中,开发方极有可能已经更新某个plug-in的版本,但本地plug-in 的metadata没有版本的信息或者没有最新版本的信息,致使maven无法下载正确的版本。同时请注意蓝色部分,这是提示的解决办法。具体步骤如下:
1.打开网址:http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/
2.选择最新版本并且下载最新的“maven-archetype-quickstart-1.0-alpha-4.jar ”文件
3.安装这个archetype到maven本地仓库。使用命令如下:mvn install:install-file -DgroupId=org.apache.maven.archtypes -Dar
tifactId=maven-archetype-quickstart -Dversion=1.0-alpha-4 -Dpackaging=jar -Dfile=c:/7000/maven/maven-archetype-quickstart-1.0-alpha-4.jar。注意-Dfile是刚下载的文件的路径。
现在在cmd中执行mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app就可以创建新项目了。
Feedback
# re: 使用maven创建新项目出现Unable to determine the release version错误 回复 更多评论
2008-04-09 09:41 by lizhh
请教一个问题:我安装了maven2.0.8版本,只有安装文件下的conf/settings.xml ,在网上看还有个用户级的settings.xml在用户目录下的.m2/settings.xml.我的.m2下怎么没有settings.xml?
# re: 使用maven创建新项目出现Unable to determine the release version错误 回复 更多评论
2008-04-10 17:06 by zjibo
.m2/settings.xml是选择默认安装目录才会有的。
相关文章推荐
- 使用MyEclipse创建Maven项目出现的错误及解决方法
- 使用Maven创建项目时总是出现异常!maven-archetype-quickstart1.1有问题
- Eclipse下使用Maven创建项目出现的archetype错误
- Eclipse下使用Maven创建项目出现的archetype错误
- Eclipse下使用Maven创建项目出现的archetype错误
- 使用Maven插件创建Web项目的详细步骤
- 用maven命令在命令行中create创建项目出现错误
- 基于maven使用IDEA创建多模块项目
- 使用IntelliJ Idea创建Maven项目
- 在eclipse中使用maven创建springMVC项目
- 使用Maven创建Java项目
- 使用maven创建web项目
- Maven学习总结(七)——eclipse中使用Maven创建Web项目
- 基于maven使用IDEA创建多模块项目
- Maven配置2-使用Maven创建WEB项目支持Tomcat目录部署
- maven项目使用springmvc+mybatis 框架页面出现404错误
- 使用maven创建多模块web项目
- 使用IntelliJ IDEA创建Maven多模块项目
- IDEA使用Maven骨架创建项目,速度慢解决办法
- Maven学习总结(七)——eclipse中使用Maven创建Web项目