I’m following this tutorial https://wiki.onosproject.org/display/ONOS/Template+Application+Tutorial for creating a CLI command that allows me to block an OF switch’s interface throught intent. I built ONOS using Bazel as suggested here https://wiki.onosproject.org/display/ONOS/Developer+Quick+Start and everything has gone well, even the creation and installation of the template application into ONOS. Now in the java class AppCommand
I imported the package org.onosproject.openflow.controller.OpenFlowController
, adding in the pom.xml file the dependency with artifactID and groupID onos-of-api-1.6.0 and when I reinstall the application this error is thrown:
Unable to perform operation on application org.foo.app
org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=foo-app; type=karaf.feature; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; filter:="(&(osgi.identity=foo-app)(type=karaf.feature)(version>=1.0.0.SNAPSHOT)(version<=1.0.0.SNAPSHOT))" [caused by: Unable to resolve foo-app/1.0.0.SNAPSHOT: missing requirement [foo-app/1.0.0.SNAPSHOT] osgi.identity; osgi.identity=org.foo.foo-app; type=osgi.bundle; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.foo.foo-app/1.0.0.SNAPSHOT: missing requirement [org.foo.foo-app/1.0.0.SNAPSHOT] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.onosproject.openflow.controller)(version>=1.6.0)(!(version>=2.0.0)))"]]
at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343) ~[?:?]
at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:392) ~[?:?]
at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:378) ~[?:?]
at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:332) ~[?:?]
at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257) ~[?:?]
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:393) ~[?:?]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062) ~[?:?]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
It seems that there is a problem with the version of the dependency but I don’t understand why.
Thanks a lot for you attention.