使用cargo实现web应用在jboss下的部署

Cargo是一个Java类包用来操作当前J2EE容器.它提供了Ant和Maven API来停止/启动/配置Java容器也提供了Java API来解释/创建J2EE组件

主要在于pom.xml中cargo plugin的配置

<plugin>
				<groupId>org.codehaus.cargo</groupId>
				<artifactId>cargo-maven2-plugin</artifactId>
				<version>1.0</version>
				<configuration>
					<wait>true</wait>
					<container>
						<containerId>jboss42x</containerId>
						<home>D:\jboss-4.2.3.GA</home>
						<log>${basedir}/target/jboss4.x.logs/cargo.log</log>
						<timeout>300000</timeout>
						<systemProperties>        <!-- This is used in jboss-log4j.xml -->
							<jboss.server.log.threshold>INFO</jboss.server.log.threshold>
						</systemProperties>
					</container>
					<!--
						cargo-configuration - name of the element will hopefully get An
						alias soon
					-->
					<configuration>      <!-- Raise permgen size, allow classes unloading and permgen sweep -->
					    <type>standalone</type>
						<properties>
							<cargo.jvmargs>-XX:PermSize=512m -XX:MaxPermSize=1024 -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled</cargo.jvmargs>
						</properties>
					</configuration>    <!-- /cargo-configuration -->
				</configuration>
				</plugin>

其中有一点特别要注意:

当jboss4.2.x时,

           Maven2 pom.xml为:<containerId>jboss42x</containerId>

           Maven1 pom.xml为:<cargo.containers>jboss42x</cargo.containers>

相关推荐