Which way is the best to go for building a webapp as osgi bundle via maven and start them with webstart?
-
13-10-2019 - |
문제
I am looking for a way to reach my vision. What is the best way to go?
Here is my vision:
- I would like to build a captain casa app via maven (as a war file).
- Then i would like to create a osgi bundle from the builded war via maven.
- Next i would like build a artifact which could be downloaded and started via java webstart (jnlp).
The jnlp file should be download the osgi environment with web container support (maybe jetty osgi service), next download osgi bundled war. Then the osgi container and the jetty service should be started and my war should be deployed. Finally the app is running local in a osgi environment.
There are many questions to be answered:
- How can i build a captain casa app via maven to a war?
- Which maven plugin should be used to build the osgi bundle (pax, maven-bundle-plugin, tycho, ...) What are the differnce?
- How to build a jnlp artifact via maven which can deployed on a site?
- How must be modified the osgi bundle to support java webstart?
Known informations:
- Blog entry to prepare osgi bundle for java webstart.
- many pages to maven plugins, such as pax, maven-bundle-plugin, tycho, bnd, ...
해결책
It might be worth asking this as 3 separate questions, but when building Web application Bundles I use the maven-bundle-plugin version 2.2.0 (currently unreleased, so you'll need to depend on a snapshot).
Then I use the following file structure:
src/main/java - any .java files src/main/resources - any non .java files that should be on the classpath src/main/webapp - static content, images, html files jsps and so on
Then inside the pom once you have configured the normal data for the maven-bundle-plugin you specify the following:
<_wab>src/main/webapp</_wab>
this will cause the static content to be pulled into the bundle and the bundle to be structured with the classes and resources in the WEB-INF/classes directory.