Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

0

Why can't my project find an artifact when I've specified it in pom-xml?

asked 2017-09-05 02:26:02 -0800

DanielRomero gravatar image

Hello,

I'm working in a ODL project and at this moment I'm in the first steps. I want to import the PacketProcessingListener and PacketReceived but I'm having an error when I use mvn clean install.

My project uses the Carbon version of ODL so to create it I used this command:

mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller
-DarchetypeArtifactId=opendaylight-startup-archetype 
-DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/opendaylight.release/ 
-DarchetypeCatalog=remote -DarchetypeVersion=1.3.0-Carbon

I have a java file (packetCounterImpl.java) in my impl/src/main/java/org/opendaylight/packetCounter/impl directory where I've imported these two classes:

import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived;

I've read that I have to add the dependency of these two classes into my pom.xml so I've used this (according to the result of the search on this website ):

<dependency>
  <groupId>org.opendaylight.openflowplugin.model</groupId>
  <artifactId>model-flow-service</artifactId>
  <version>0.4.2-Carbon</version>
</dependency>

(BTW I'm not sure if that version is the appropriate for this case).

Finally, when I use the mvn clean install command I get this error:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building ODL :: org.opendaylight.packetCounter :: packetCounter-impl 0.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/openflowplugin/model/model-flow-service/0.4.2-Carbon/model-flow-service-0.4.2-Carbon.pom
Downloading: https://repo.maven.apache.org/maven2/org/opendaylight/openflowplugin/model/model-flow-service/0.4.2-Carbon/model-flow-service-0.4.2-Carbon.pom
[WARNING] The POM for org.opendaylight.openflowplugin.model:model-flow-service:jar:0.4.2-Carbon is missing, no dependency information available
Downloading: https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/openflowplugin/model/model-flow-service/0.4.2-Carbon/model-flow-service-0.4.2-Carbon.jar
Downloading: https://repo.maven.apache.org/maven2/org/opendaylight/openflowplugin/model/model-flow-service/0.4.2-Carbon/model-flow-service-0.4.2-Carbon.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.480 s
[INFO] Finished at: 2017-09-05T10:29:57+02:00
[INFO] Final Memory: 31M/277M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project packetCounter-impl: Could not resolve dependencies for project org.opendaylight.packetCounter:packetCounter-impl:bundle:0.1.0-SNAPSHOT: Could not find artifact org.opendaylight.openflowplugin.model:model-flow-service:jar:0.4.2-Carbon in opendaylight-mirror (https://nexus.opendaylight.org/content/repositories/public/) -> [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/DependencyResolutionException

I'd appreciate some help to solve this problem.

Thank you.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-09-05 22:17:36 -0800

Hi Daniel,

You are using version 1.3.0-Carbon for the archetype generation, which corresponds to the original Carbon release. The corresponding model-flow-version would be 0.4.0-Carbon. The last digit in the version, the patch-level, indicates the Service Release. For Carbon, only SR1 was released, and SR2 is being prepared now. If you click in the search results on the 0.4.2-Carbon artifact you found you will see that it belongs to an "autorelease" repository. While public, it's best to use only "public" repositories.

So I would recommend using Carbon SR1 artifacts for now, 1.3.1-Carbon for the archetype generation and 0.4.1-Carbon for your dependency. For some reason the search results also show 0.4.1 as autorelease repo, but if I check Nexus, it's actually available in the release repo:

https://nexus.opendaylight.org/conten...

Alternatively, while developing you can use the original version too, 0.4.0-Carbon to match your archetype, and upgrade later.

edit flag offensive delete publish link more

Comments

Thanks Lori. I've used the 0.4.1-Carbon version for the dependecy and it works! And thank you for the explanation. I think I can understand now the meaning of these set of numbers haha.

DanielRomero ( 2017-09-06 00:15:28 -0800 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2017-09-05 02:26:02 -0800

Seen: 43 times

Last updated: Sep 05