how to develop, build and deploy multiple OSGi based web applications

北城以北 提交于 2019-12-06 10:45:57

问题


I'm search for a way to develop, build and deploy multiple OSGi based web applications (some RAP).

To start I use the RAP examples cloned from: https://github.com/eclipse/rap.git

In releng/org.eclipse.rap.examples.build there are three applications which can be built as war files using:

mvn clean verify

The resulting war files include all the dependencies and the required equinox servletbridge for the OSGi environment.
Now I can copy the war files and drop them into the webapps of the application server e.g. tomcat:

rapdemo.war > http://127.0.0.1:8080/rapdemo/
workbench.war > http://127.0.0.1:8080/workbench/
controls.war > http://127.0.0.1:8080/controls/

This works great, but how can I develop in Eclipse and automatically deploying to the tomcat/jetty/... using the equinox servletbridge?

I tried using the jetty maven plugin, adding the following to the pom files:

<plugin>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>9.4.15.v20190215</version>
</plugin>

I get the following messages in the console and jetty is not running:

[INFO] Skipping org.eclipse.rap.examples.rapdemo.product : packaging type [eclipse-repository] is unsupported ...
[INFO] Skipping RAP demo examples build : packaging type [pom] is unsupported

Maybe I need additional maven projects with packaging type war and a similiar configuration like this:

<configuration>
    <scanIntervalSeconds>10</scanIntervalSeconds>
    <webApp>
        <contextPath>/</contextPath>
    </webApp>
    <contextHandlers>
        <contextHandler
            implementation="org.eclipse.jetty.maven.plugin.JettyWebAppContext">
            <war>${project.basedir}/rapdemo/target/rapdemo.war</war>
            <contextPath>/rapdemo</contextPath>
        </contextHandler>
        ...
    </contextHandlers>
</configuration>

来源:https://stackoverflow.com/questions/55122898/how-to-develop-build-and-deploy-multiple-osgi-based-web-applications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!