Good way to “wrap” jars for OSGi with Maven

后端 未结 4 1706
名媛妹妹
名媛妹妹 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条回答
  •  情深已故
    2021-02-10 04:28

    I wrote a maven archetype that will help you wrap a jar as an OSGI bundle.

    Let's say you want to wrap commons-collections version 3.2.1

    First get the archetype and install it

    git clone git://github.com/HallwayTech/maven-wrap-jar-archetype.git 
    cd maven-wrap-jar-archetype
    maven install
    

    Then use the archetype to start your project.

    mvn archetype:create \
      -DarchetypeGroupId=com.hallwaytech.osgi \
      -DarchetypeArtifactId=wrap-jar \
      -DarchetypeVersion=1.0-SNAPSHOT \
      -DgroupId=commons-collections \
      -DartifactId=commons-collections \
      -Dversion=3.2.1
    

    cd commons-collections

    mvn install
    

    To deploy to a Apache Sling inside of Felix run:

    mvn install -Pdeploy
    

提交回复
热议问题