Maven说原型不存在

时间:2014-03-24 15:41:45

标签: maven jpa

我正在尝试使用Maven和eclipse创建一个基于JPA的项目。我尝试在eclipse项目创建中使用创建新maven项目的jpa-maven-archetype,但它回击了这个错误

Could not resolve archetype com.rfc.maven.archetypes:jpa-maven-archetype:RELEASE from any of the configured repositories.
Could not resolve artifact com.rfc.maven.archetypes:jpa-maven-archetype:pom:RELEASE
Failed to resolve version for com.rfc.maven.archetypes:jpa-maven-archetype:pom:RELEASE:   Could not find metadata com.rfc.maven.archetypes:jpa-maven-archetype/maven-metadata.xml in local (/home/sebastian/.m2/repository) 
Failed to resolve version for com.rfc.maven.archetypes:jpa-maven-archetype:pom:RELEASE: Could not find metadata com.rfc.maven.archetypes:jpa-maven-archetype/maven-metadata.xml in local (/home/sebastian/.m2/repository)

基本上,eclipse插件正在查看我的本地存储库而不是远程存储库。所以我尝试使用命令行并使用以下命令显式指定远程存储库

mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create \
  -DgroupId=com.something -DartifactId=jpaexample \
  -DarchetypeArtifactId=jpa-maven-archetype \
  -DarchetypeVersion=RELEASE \
  -DremoteRepositories=http://maven.rodcoffin.com/repo \
  -DinteractiveMode=false

我收到了这个错误

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create (default-cli) on project standalone-pom: Error creating from archetype: Error attempting to download archetype. Error downloading. Failed to resolve version for org.apache.maven.archetypes:jpa-maven-archetype:jar:RELEASE: Could not find metadata org.apache.maven.archetypes:jpa-maven-archetype/maven-metadata.xml in local (/home/sebastian/.m2/repository)
[ERROR] org.apache.maven.archetypes:jpa-maven-archetype:jar:RELEASE
[ERROR] 
[ERROR] from the specified remote repositories:
[ERROR] id0 (http://maven.rodcoffin.com/repo, releases=true, snapshots=true)
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

似乎repo maven.rodcoffin.com/repo无效,或者我的maven设置有问题。我不确定哪一个,如果有人可以给我指点在哪里搜索,那将会有所帮助。

此外,如果repo maven.rodcoffin.com/repo无效。我有什么其他选择来创建JPA原型项目。我是否必须制作一个简单的maven项目,然后将其转换为JPA,如here所示。

编辑:我只是通过创建一个maven快速类型的achetype,然后使用persistence.xml为我的项目来解决问题。 所以请忽略这个问题。

0 个答案:

没有答案