我想使用带有 maven 插件的 hudson 以这种方式将应用程序部署到 Jboss 6 服务器:
- Hudson 调用 maven 全新安装任务
- 在 pom.xml 文件中定义了 cargo plugin(版本 1.0.6)
- cargo 插件已经为阶段安装定义了执行重新部署,目标停止和启动(按此顺序)
一切正常 - 项目被清理然后安装,然后 jboss 服务器停止(使用 cargo:stop)并再次启动(使用 cargo:start)。在开始的目标是与我的项目部署到 jboss 的战争。当我测试我的网络时,它可以工作并且所有更改都存在。
唯一的问题是,在 Jboss 服务器启动后,maven 没有成功完成其执行,因为它显示消息“[INFO] Press Ctrl-C to stop the container...”并等待按 Ctrl-C。这是标准的 cargo:start 行为。结果是,Hudson 作业没有成功完成。
我现在要求的是针对这个小问题的某种解决方法。我需要很长时间(大约 16 个小时)才能达到这种状态,如果我不得不完全重新加工它,我不会很高兴。
我的想法怎么会去(但我无法谷歌任何有用的东西):
- 强制哈德森在后台运行 maven 任务
- 强制 cargo 在后台运行 jboss(一些 spawn、fork、jvm 参数、jboss 运行时参数)
- 强制maven在后台运行任务
我之所以尝试这个解决方案是因为我想让 jboss 在服务器上永久运行,而货物远程部署选项对我不利,因为它使用了太多的系统资源。该解决方案应该适用于安装项目然后重新启动服务器(停止 - 启动)。
谢谢你的帮助。这是我的货物插件配置:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0.6</version>
<configuration>
<container>
<containerId>jboss6x</containerId>
<append>false</append>
<timeout>300000</timeout>
<home>/atteq/jboss</home>
</container>
<configuration>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.jboss.configuration>atteq-minimal</cargo.jboss.configuration>
<cargo.logging>high</cargo.logging>
<cargo.rmi.port>1099</cargo.rmi.port>
<cargo.jvmargs>-XX:PermSize=512m -XX:MaxPermSize=1024
-XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled
-XX:+CMSClassUnloadingEnabled</cargo.jvmargs>
<cargo.runtime.args>--host 0.0.0.0</cargo.runtime.args>
</properties>
<type>existing</type>
<home>/atteq/jboss/server/atteq-minimal</home>
<deployables>
<deployable>
<groupId>roztocto</groupId>
<artifactId>roztocto</artifactId>
<type>war</type>
</deployable>
</deployables>
</configuration>
</configuration>
<executions>
<execution>
<id>redeploy</id>
<phase>install</phase>
<goals>
<goal>stop</goal>
<goal>start</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-core-tools-jboss-deployer-5.1-and-onwards</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-profileservice-client</artifactId>
<version>6.0.0.Final</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.profileservice</groupId>
<artifactId>jboss-profileservice-spi</artifactId>
<version>0.2.2</version>
</dependency>
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
<version>6.0.0.Final</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>