packaging maven project jboss fuse -
in project connect mysql database. deploy jar on jboss fuse need add mysql-connector-java deploy folder. have idea how package project deliver single jar?
to embed jar inside bundle following:
1) declare dependency
<dependencies> <dependency> <groupid>com.your.company</groupid> <artifactid>your-needed-jar</artifactid> <version>1.3.4</version> </dependency> <dependencies>
2) tell maven-bundle-plugin embed it.
<build> <plugins> <plugin> <groupid>org.apache.felix</groupid> <artifactid>maven-bundle-plugin</artifactid> <version>3.0.1</version> <extensions>true</extensions> <configuration> <instructions> <embed-dependency>your-needed-jar</embed-dependency> <import-package> eventually.unneded.pkg;resolution:="optional", * </import-package> <export-package> com.your.company.app.exportedpkg </export-package> </instructions> </configuration> </plugin> </plugins> </build>
while work in general cases, there may classloading issues libraries lot of runtime class proxying , class generation (like orms).
imho better approach make library available jboss fuse itself. so:
1) copy mysql-connector-java-xxx.java
in jboss fuse lib/ directory
2) edit config.properties
in jboss etc/ fuse directory
3) add com.mysql.jdbc
package list
org.osgi.framework.system.packages= \ ... org.apache.karaf.diagnostic.core;version="2.4.0.redhat-621084", \ com.mysql.jdbc;version="xxx", \
now don't need embed library in bundle, can directly import it. system bundle (id:0) exporting it.
for further reference pdf document may provide helpful information: red hat jboss fuse 6.2 managing osgi dependencies
Comments
Post a Comment