Recreating Quickstart rest/impl Discrepancy
Camzra opened this issue · 2 comments
When working through the enRoute quickstart tutorial , on the second page instructions for Creating the Debug Version of quickstart, I am getting an error creating the indexes at the top of the project.
mvn bnd-indexer:index bnd-indexer:index@test-index
It appears that the project template created the "impl" sub-project but the sonatype repository doesn't have a template for "impl". The repository does have a template called "rest". I changed the app/pom.xml to reference the "rest" artifact as a dependency instead of "impl". This allows the successful construction of the index, but the next step, mvn bnd-resolver:resolve
fails because it can't find the rest sub-project.
Additional note. I was able to continue the tutorial by changing the "impl" sub-project to "rest" and updating the app.bndrun file to look for "rest" instead of "impl". It looks like a discrepancy in the project template somewhere.
I had a similar issue as @RCHinds .
[ERROR] Failed to execute goal on project app: Could not resolve dependencies for project
org.osgi.enroute.examples.quickstart:app:jar:1.0-SNAPSHOT: Could not find artifact
org.osgi.enroute.examples.quickstart:impl:jar:1.0-SNAPSHOT in OSGi
(https://oss.sonatype.org/content/groups/osgi)
I noticed while updating the app.bndrun
in the first page tutorial here, org.osgi.enroute.examples.quickstart.rest
was shown in the example app.bndrun
code snippet but it was not present in my app.bndrun
after I ran
quickstart/app $ mvn -pl app -am bnd-indexer:index bnd-indexer:index@test-index bnd-resolver:resolve package
How To Resolve quickstart/app $ mvn bnd-indexer:index bnd-indexer:index@test-index
To get mvn bnd-indexer:index bnd-indexer:index@test-index
to work before you change the pom file to include the word debug
as mentioned in the tutorial:
Change lines 17-19 of the quickstart/app/pom.xml
from
<groupId>org.osgi.enroute.examples.quickstart</groupId>
<artifactId>impl</artifactId>
<version>1.0-SNAPSHOT</version>
to be the rest artifact with a different version:
<groupId>org.osgi.enroute.examples.quickstart</groupId>
<artifactId>rest</artifactId>
<version>0.0.1-SNAPSHOT</version>
Then, change part of the quickstart/app/app.bndrun
(which was line 20 for me) from
org.osgi.enroute.examples.quickstart.impl;version='[1.0.0,1.0.1)',\
to match what was outputted in the example, so it is also the rest artifact with a different version:
org.osgi.enroute.examples.quickstart.rest;version='[0.0.1,0.0.2)',\
This works because there is a version of the rest artifact available for download from sonatype bot not one for impl.
How To Resolve quickstart/app $ mvn bnd-resolver:resolve
To get mvn bnd-resolver:resolve
to work AFTER you change the pom file to include the word debug
as mentioned in the tutorial:
Change line 5 of the app.bndrun
from
-runrequires: osgi.identity;filter:='(osgi.identity=org.osgi.enroute.examples.quickstart.impl)'
to this
-runrequires: osgi.identity;filter:='(osgi.identity=org.osgi.enroute.examples.quickstart.rest)'
Change part of the quickstart/app/debug.bndrun
(which was line 35 for me) from
org.osgi.enroute.examples.quickstart.impl;version='[1.0.0,1.0.1)',\
to match what was outputted in the example, so it is also the rest artifact with a different version:
org.osgi.enroute.examples.quickstart.rest;version='[0.0.1,0.0.2)',\
The mvn verify
command should also work after this, and so should java -jar target/debug.jar