Good way to “wrap” jars for OSGi with Maven

后端 未结 4 1720
名媛妹妹
名媛妹妹 2021-02-10 03:32

I was looking at the PAX tools on OPS4J for example: this one and I thought I\'d found a nice way to:

  • Specify an artifact
  • Create an assembled jar (jar tha
4条回答
  •  Happy的楠姐
    2021-02-10 04:33

    I tried The accepted answer and Erik's answer. Erik's suggestion was simple and worked right out the box. Although, it seemed to produce a huge MANIFEST in my case, and then I recalled the p2-maven-plugin. This last method works very well in a large number of cases. If the artifact you need is already bundle, or its dependencies are bundles it simply puts them into the repo it builds. If not, it will run maven-bundle-plugin with some default settings (or you can configure the settings you need). Very cool!

    I especially like that it grabs the transitive dependencies and takes care of those too. If you don't need the repo, but are just after the wrapped bundle, it is a simple matter to go cherry pick it out of target/repository/plugins folder.

提交回复
热议问题