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

error when adding a third party dependency to a basic project

asked 2016-01-05 10:17:53 -0700

hpu gravatar image

I created a new project as part of learning ODL. I essentially followed the first few steps given in https://wiki.opendaylight.org/view/Op...Controller:MD-SAL:StartupProject_Archetype to create my project. Additionally I added code which has dependency on the third party snmp4j jar.

To include this dependency I added the following in impl/pom.xml under dependencies section.

<dependency> <groupid>org.apache.servicemix.bundles</groupid> <artifactid>org.apache.servicemix.bundles.snmp4j</artifactid> <version>2.3.4_1</version> </dependency>

If I do "mvn clean install" under impl directory everything goes through fine and I can see the snmp4j osgi packages downloaded in my local repository (~/.m2/repository/org/apache/servicemix/bundles/org.apache.servicemix.bundles.snmp4j/2.3.4_1)

But when I do "mvn clean install" for the main directory I get the following error.

Tests in error: Unresolved constraint in bundle org.opendaylight.proto.impl [205]: Unable to resolve 205.0: missing requirement [205.0] osgi.wiring.package; (&(osgi.wiring.package=org.snmp4j)(version>=2.3.0)(!(version>=3.0.0)))
Unresolved constraint in bundle org.opendaylight.proto.impl [205]: Unable to resolve 205.0: missing requirement [205.0] osgi.wiring.package; (&(osgi.wiring.package=org.snmp4j)(version>=2.3.0)(!(version>=3.0.0)))
Unresolved constraint in bundle org.opendaylight.proto.impl [205]: Unable to resolve 205.0: missing requirement [205.0] osgi.wiring.package; (&(osgi.wiring.package=org.snmp4j)(version>=2.3.0)(!(version>=3.0.0)))

Tests run: 4, Failures: 0, Errors: 3, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] proto-api ................................... SUCCESS [ 6.184 s]
[INFO] proto-impl .................................. SUCCESS [ 6.092 s]
[INFO] proto-features .............................. FAILURE [01:01 min]
[INFO] proto-karaf ................................. SKIPPED
[INFO] proto-artifacts ............................. SKIPPED
[INFO] proto ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

Here is the detailed stack trace for one of the errors.

Tests run: 4, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 56.171 sec <<< FAILURE! - in org.opendaylight.odlparent.featuretest.SingleFeatureTest installFeature(org.opendaylight.odlparent.featuretest.SingleFeatureTest)[repoUrl: file:~/odl/ws/proto/features/target/classes/features.xml, Feature: odl-proto 1.0-SNAPSHOT] Time elapsed: 15.025 sec <<< ERROR!
org.osgi.framework.BundleException: Unresolved constraint in bundle org.opendaylight.proto.impl [205]: Unable to resolve 205.0: missing requirement [205.0] osgi.wiring.package; (&(osgi.wiring.package=org.snmp4j)(version>=2.3.0)(!(version>=3.0.0)))
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2037)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942)
at org.apache.karaf.features.internal.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:477)
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:435)
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:375)
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:364)
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:347)
at Proxyb610e232100a4a709cb0181a67099ac0.installFeature(Unknown Source)
at org.opendaylight.odlparent.featuretest.SingleFeatureTest.installFeature(SingleFeatureTest.java:207)
at sun.reflect ...












(more)

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2016-01-05 12:16:40 -0700

hpu gravatar image

updated 2016-01-05 12:17:18 -0700

I added the missing dependency in features/src/main/features/features.xml and now the compilation works fine. I added it under the main feature "odl-proto".

<feature name='odl-proto' version='${project.version}' description='OpenDaylight :: proto'>
<feature version='${mdsal.version}'>odl-mdsal-broker</feature>
<feature version='${project.version}'>odl-proto-api</feature>
<bundle>mvn:org.opendaylight.proto/proto-impl/${project.version}</bundle>
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j/2.3.4_1</bundle>
<configfile finalname="${configfile.directory}/proto.xml">mvn:org.opendaylight.proto/proto-impl/${project.version}/xml/config</configfile>
</feature>
edit flag offensive delete publish link more
0

answered 2017-08-30 01:44:16 -0700

245380 gravatar image

I'm building odlparent project with settings.xml given at below location https://github.com/opendaylight/odlpa...

But I'm getting below errors: [ERROR] Invalid extension descriptor for org.apache.karaf.tooling:karaf-maven-plugin:4.0.9: error in opening zip file [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] Unknown packaging: bundle @ org.opendaylight.odlparent:bundles4-test:[unknown-version], D:\Software\odlparent\bundles4-test\pom.xml, line 22, column 14 [ERROR] Unknown packaging: bundle @ org.opendaylight.odlparent:features-test:[unknown-version], D:\Software\odlparent\features-test\pom.xml, line 22, column 16 [ERROR] Unknown packaging: bundle @ org.opendaylight.odlparent:karaf.branding:[unknown-version], D:\Software\odlparent\karaf\karaf-branding\pom.xml, line 12, column 14 [ERROR] Unknown packaging: bundle @ org.opendaylight.odlparent:karaf-util:[unknown-version], D:\Software\odlparent\karaf-util\pom.xml, line 22, column 16 [ERROR] Unknown packaging: feature @ org.opendaylight.odlparent:features-akka:[unknown-version], D:\Software\odlparent\features\features-akka\pom.xml, line 22, column 16 [ERROR] Unknown packaging: feature @ line 24, column 16 [ERROR] Unknown packaging: feature @ line 24, column 16 [ERROR] Unknown packaging: feature @ line 24, column 16 [ERROR] Unknown packaging: feature @ line 24, column 16 [ERROR] Unknown packaging: feature @ line 24, column 16 [ERROR] Unknown packaging: feature @ line 24, column 16 [ERROR] Unknown packaging: kar @ org.opendaylight.odlparent:odl-karaf-feat-feature:[unknown-version], D:\Software\odlparent\features\odl-karaf-feat-feature\pom.xml, line 23, column 16 [ERROR] Unknown packaging: kar @ org.opendaylight.odlparent:odl-karaf-feat-jdbc:[unknown-version], D:\Software\odlparent\features\odl-karaf-feat-jdbc\pom.xml, line 23, column 16 [ERROR] Unknown packaging: kar @ org.opendaylight.odlparent:odl-karaf-feat-jetty:[unknown-version], D:\Software\odlparent\features\odl-karaf-feat-jetty\pom.xml, line 23, column 16 [ERROR] Unknown packaging: kar @ org.opendaylight.odlparent:odl-karaf-feat-war:[unknown-version], D:\Software\odlparent\features\odl-karaf-feat-war\pom.xml, line 23, column 16 [ERROR] Unknown packaging: feature @ org.opendaylight.odlparent:features-odlparent:[unknown-version], D:\Software\odlparent\features\features-odlparent\pom.xml, line 22, column 16 [ERROR] Unknown packaging: feature @ line 24, column 16 [ERROR] Unknown packaging: feature @ line 24, column 16 [ERROR] Unknown packaging: feature @ line 24, column 16 [ERROR] Unknown packaging: feature @ line 24, column 16 @ [ERROR] The build could not read 20 projects -> [Help 1] [ERROR] [ERROR] The project org.opendaylight.odlparent:bundles4-test:3.0.0-SNAPSHOT (D:\Software\odlparent\bundles4-test\pom.xml) has 1 error [ERROR] Unknown packaging: bundle @ org.opendaylight.odlparent:bundles4-test:[unknown-version], D:\Software\odlparent\bundles4-test\pom.xml, line 22, column 14 [ERROR] [ERROR] The project org.opendaylight.odlparent:features-test:3.0.0-SNAPSHOT (D:\Software\odlparent\features-test\pom.xml) has 1 error [ERROR] Unknown packaging: bundle @ org.opendaylight.odlparent:features-test:[unknown-version], D:\Software\odlparent\features-test\pom.xml, line 22, column 16 [ERROR] [ERROR] The project org.opendaylight.odlparent:karaf.branding:3.0.0-SNAPSHOT (D:\Software\odlparent\karaf\karaf-branding\pom.xml) has 1 error [ERROR] Unknown packaging: bundle @ org.opendaylight.odlparent:karaf.branding:[unknown-version], D:\Software\odlparent\karaf\karaf-branding\pom.xml, line 12, column 14 [ERROR] [ERROR] The project org.opendaylight.odlparent:karaf-util:3.0.0-SNAPSHOT (D:\Software\odlparent\karaf-util\pom.xml) has 1 error [ERROR] Unknown packaging: bundle @ org.opendaylight.odlparent:karaf-util:[unknown-version], D:\Software\odlparent\karaf-util\pom.xml, line 22, column 16 [ERROR ... (more)

edit flag offensive delete publish link more

Comments

Either your pom.xml is not set correctly, or you have noise in your maven repository, in which case you should try deleting your maven repository and trying again.

VincentJahjah ( 2017-08-30 05:47:43 -0700 )edit
Login/Signup to Answer

Stats

Asked: 2016-01-05 10:17:53 -0700

Seen: 334 times

Last updated: Aug 30