Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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?

like image 252
Adam Avatar asked Jun 12 '13 17:06

Adam


People also ask

How to fix Maven artifacts could not be resolved error?

How to Fix Maven Artifacts Could not be Resolved Error? Exclude jms, jmxri & jmxtools JAR Dependencies I remember long time ago, I faced the same error and I tried fixing it by manually adding .jar files to my maven repository locally. I executed below command to install it in my localhost maven repo and everything worked.

What are Maven artifacts in Maven?

Maven artifacts are not limited to java resources. We can generate whatever resource we need like, documentation, project-site, zip-archives, native-libraries, etc. Each maven project has a unique identifier consisting of [groupId, artifactId, version].

What is the first cup of Java EE tutorial?

The First Cup of Java EE Tutorial teaches and demonstrates Java EE basics and is intended for beginners. The latest build of the First Cup of Java EE Tutorial is automatically published to this site as HTML. The tutorial is authored in AsciiDoc.

How to fix Maven builds not downloading jars error?

Check if the jar is missing or not. If yes, place it manually in the .m2 repository. Sometimes the jar mentioned in the pom.xml is not downloaded and it gives error. You can also try deleting the entire .m2 repository folder and run the maven build. The jars get downloaded from scratch. It might resolve the problem as well.


2 Answers

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.

like image 120
Ian Evans Avatar answered Nov 09 '22 18:11

Ian Evans


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.

like image 40
Adam Avatar answered Nov 09 '22 19:11

Adam