osgi-in-action pax exam example code not working

匆匆过客 提交于 2021-01-29 15:44:12

问题


I am studying osgi-in-action to understand pax exam

unfortunately the provided examples are not working.

  1. I have downloaded the source from osgi-in-action code on github
  2. changed into the directory [osgi-in-action]/chapter07/testing-example
  3. executed: ant test.container
  4. 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:

  1. the bundle pax-exam-1.1.0.jar is in [osgi-in-action]/lib/pax
  2. 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]
    
  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!