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.
Java EE 7 First Cup Tutorial errors in Maven: Could not find artifact org.glassfish.javaeetutorial.firstcup:firstcup:pom:7.0.1-SNAPSHOT
-
31-05-2022 - |
Question
I'm following along with the Java EE 7 updated version of FirstCup. I have glassfish 4 installed and am using NetBeans 7.3. I'm working on the very first example and I'm getting maven issues.
I generated the archetypes and am able to create the dukes-age project. However it has non-resolvable maven issues:
Could not find artifact 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.
Any ideas?
La solution 2
Autres conseils
Filed this issue as: 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.
To get it to resolve the parent pom, you also need to install the examples application tutorial at NetBeans/glassfish-4.0/docs/firstcup/example/pom.xml.
I had the same error, in my case it was because I copied the glassfish folder with the example in to the C:\programs folder and Netbeans, after i copied it in Documents all works fine.