我正在寻找一种方法来开发、构建和部署多个基于 OSGi 的 Web 应用程序(一些 RAP)。
首先,我使用从以下位置克隆的 RAP 示例:https://github.com/eclipse/rap.git https://github.com/eclipse/rap.git
In releng/org.eclipse.rap.examples.build
可以使用以下三个应用程序将其构建为 war 文件:
mvn clean verify
生成的 war 文件包含 OSGi 环境的所有依赖项和所需的 equinox servletbridge。
现在我可以复制 war 文件并将它们放入webapps
应用程序服务器的例如雄猫:
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/
这很好用,但是我如何在 Eclipse 中开发并使用以下命令自动部署到 tomcat/jetty/...Equinox servletbridge?
我尝试使用 jetty maven 插件,将以下内容添加到 pom 文件中:
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.15.v20190215</version>
</plugin>
我在控制台中收到以下消息,但 jetty 未运行:
[INFO] 跳过 org.eclipse.rap.examples.rapdemo.product :打包
类型 [eclipse-repository] 不受支持...
[INFO] 跳过 RAP 演示
示例构建:不支持打包类型 [pom]
也许我需要额外的打包类型的 Maven 项目war
和类似的配置如下:
<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>