问题
I am studying osgi-in-action to understand pax exam
unfortunately the provided examples are not working.
- I have downloaded the source from osgi-in-action code on github
- changed into the directory [osgi-in-action]/chapter07/testing-example
- executed: ant test.container
in the logfile i see
... Caused by: org.ops4j.pax.runner.platform.PlatformException: [mvn:org.ops4j.pax.exam/pax-exam/1.1.0] is not a valid bundle ... Caused by: java.util.zip.ZipException: error in opening zip file ...
I am confused by this error and don't know where to investigate on.
I understand:
- the bundle pax-exam-1.1.0.jar is in [osgi-in-action]/lib/pax
before the error the log says
Provision bundle [mvn:org.ops4j.pax.exam/pax-exam/1.1.0, at start level 1, bundle will be started, bundle will be loaded from the cache]
the ant build.xml provides
<property name="build.cp" value="${junit.jar}: ... ${lib}/pax/pax-exam-1.1.0.jar"/>
Main Question:
- How can i make the pax runner use the provided jar file?
Side Questions:
- Why does the pax runner try to download even though it said the bundle will be loaded from the cache?
- Why can't the pax runner download the artifact even though it is available at maven central?
[EDIT] I have also opened an issue on the respective github repository link to issue
[2nd EDIT] when i make sure the respective jar/bundle is available in my local maven repository the issue is not coming up. But as I consider this as a workaround and not a correct answer to my stated question, I leave the question open
来源:https://stackoverflow.com/questions/61540878/osgi-in-action-pax-exam-example-code-not-working