It probably won't be the most convenient solution, but :
You can create a Maven project with such structure
src
- main
- - resources
- - - OSGI-INF
- - - - blueprint
- - - - - blueprint.xml
pom.xml
Necessarily:
<packaging>bundle</packaging>
In the pom.xml you can set all the bundle parameters you need:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Description>${project.description}</Bundle-Description>
<Bundle-Version>1.0.0</Bundle-Version>
<Import-Package>*</Import-Package>
</instructions>
</configuration>
</plugin>
Build your bundle and get the jar file for deployment
The level of the bundle is started, you can define in the config.properties
#
# Definition of the default bundle start level
#
org.osgi.framework.startlevel.beginning=100
karaf.startlevel.bundle=80
Also you can create feature for your bundle and reset start level:
<feature name="my-project" version="1.0.0">
<bundle start-level="80" start="false">mvn:com.mycompany.myproject/myproject-dao</bundle>
<bundle start-level="85" start="false">mvn:com.mycompany.myproject/myproject-service</bundle>
</feature>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…