---
title: "使用maven创建新项目出现Unable to determine the release vers"
author: "zhuozuoying"
date: "2008-12-19T10:13:17Z"
tags: []
slug: "maven-unable-to-determine-the-release-vers"
draft: false
lastmod: "2008-12-19T10:16:49Z"
id: 297157
url: "https://zzy603.iteye.com/blog/297157"
---

当使用mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app来创建一个新项目时，有时候会出现以下错误：

 Scanning for projects...
 Searching repository for plugin with prefix: 'archetype'.

----------------------------------------------------------------------------
 Building Maven Default Project
    task-segment:  (aggregator-style)

----------------------------------------------------------------------------
。。。。。。。
 Velocimacro : initialization complete.
 Velocity successfully started.
 
 Defaulting package to group ID: com.mycompany.app

------------------------------------------------------------------------
 BUILD ERROR

------------------------------------------------------------------------
 Failed to resolve artifact.

<span style="color:red">GroupId: org.apache.maven.archetypes
ArtifactId: maven-archetype-quickstart
Version: RELEASE

Reason: Unable to determine the release version</span>
<span style="color:blue">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</span>
  org.apache.maven.archetypes:maven-archetype-quickstart:jar:RELEASE

 
------------------------------------------------------------------------
 For more information, run Maven with the -e switch

------------------------------------------------------------------------
 Total time: 1 second
 Finished at: Tue Apr 17 07:08:50 MDT 2007
 Final Memory: 4M/8M

------------------------------------------------------------------------

        请注意红色部分为错误产生的根本原因，  由于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就可以创建新项目了。