简体   繁体   English

Maven中的Java EE 7 First Cup Tutorial错误:无法找到工件org.glassfish.javaeetutorial.firstcup:firstcup:pom:7.0.1-SNAPSHOT

[英]Java EE 7 First Cup Tutorial errors in Maven: Could not find artifact org.glassfish.javaeetutorial.firstcup:firstcup:pom:7.0.1-SNAPSHOT

I'm following along with the Java EE 7 updated version of FirstCup. 我正在关注FirstCup的Java EE 7更新版本。 I have glassfish 4 installed and am using NetBeans 7.3. 我安装了glassfish 4并使用NetBeans 7.3。 I'm working on the very first example and I'm getting maven issues. 我正在研究第一个例子,我正在解决maven问题。

I generated the archetypes and am able to create the dukes-age project. 我生成了原型,并且能够创建dukes-age项目。 However it has non-resolvable maven issues: 但是它有不可解决的maven问题:

Could not find artifact org.glassfish.javaeetutorial.firstcup:firstcup:pom:7.0.1-SNAPSHOT 找不到工件org.glassfish.javaeetutorial.firstcup:firstcup:pom:7.0.1-SNAPSHOT

Here is the full error: 这是完整的错误:

[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.mycompany:dukes-age:1.0-SNAPSHOT (/Users/koblentz/NetBeansProjects/dukes-age/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM: Could not find artifact    org.glassfish.javaeetutorial.firstcup:firstcup:pom:7.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13 -> [Help 2]
[ERROR] 

I'm not really sure what to do/how to fix this. 我不确定该怎么做/如何解决这个问题。 I deleted my local cache in the .m2 repo and tried building from the commandline instead of using NB to run the maven commands. 我删除了.m2 repo中的本地缓存,并尝试从命令行构建而不是使用NB来运行maven命令。

Any ideas? 有任何想法吗?

Filed this issue as: https://java.net/jira/browse/FIRSTCUP-14 提交此问题为: https//java.net/jira/browse/FIRSTCUP-14

The workaround is to replace the parent definition: 解决方法是替换父定义:

<parent>
<artifactId>firstcup</artifactId>
<groupId>org.glassfish.javaeetutorial.firstcup</groupId>
<version>7.0.1</version>

I'm working on getting an updated package in the Update Center. 我正在努力在更新中心获取更新的包。

Fixed it. 固定它。 The pom generated by the archetype is looking for 7.0.1-SNAPSHOT and the actual version in m2 repo is 7.0.1 without the SNAPSHOT on the end. 原型生成的pom正在寻找7.0.1-SNAPSHOT,m2 repo中的实际版本是7.0.1,最后没有SNAPSHOT。

要使其解析父pom,还需要在NetBeans / glassfish-4.0 / docs / firstcup / example / pom.xml中安装示例应用程序教程。

我有同样的错误,在我的情况下,因为我将带有示例的glassfish文件夹复制到C:\\ programs文件夹和Netbeans, 在我将它复制到Documents之后一切正常

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM