我从this page得知Cargo Maven插件不支持热远程部署到GlassFish 3.x吗?如果我错了,我怎么配置它来支持这种类型的操作?使用cargo-maven2插件对GlassFish进行热部署,如何配置?
也许我应该使用其他插件?我想通过HTTP以“热”模式部署到GlassFish远程安装。
我从this page得知Cargo Maven插件不支持热远程部署到GlassFish 3.x吗?如果我错了,我怎么配置它来支持这种类型的操作?使用cargo-maven2插件对GlassFish进行热部署,如何配置?
也许我应该使用其他插件?我想通过HTTP以“热”模式部署到GlassFish远程安装。
这是我迄今所做的:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<tasks>
<tempfile property="ant.temp-ear" deleteonexit="true" destdir="/tmp" />
<copy
file="${project.build.directory}/${project.build.finalName}.${project.packaging}"
tofile="${ant.temp-ear}" verbose="true" />
<exec executable="${glassfish.home}/glassfish/bin/asadmin"
failonerror="true">
<arg value="--user=${glassfish.username}"/>
<arg value="--passwordfile=${glassfish.passwordfile}"/>
<arg value="--interactive=false"/>
<arg value="--host=${glassfish.host}"/>
<arg value="--port=${glassfish.adminport}"/>
<arg value="deploy"/>
<arg value="--force"/>
<arg value="--name=${project.artifactId}"/>
<arg value="${ant.temp-ear}"/>
</exec>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
作品完美,但asadmin
(以及整个GlassFish中,我假设),必须在其中执行mvn
在同一台机器上安装。
是否可以使用Cargo插件执行相同的任务?
这是回答您的问题吗?
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>glassfish3x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.hostname>dev-server-01</cargo.hostname>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.remote.username>user</cargo.remote.username>
<cargo.remote.password>pass</cargo.remote.password>
<cargo.glassfish.domain.name>domain-name</cargo.glassfish.domain.name>
<cargo.glassfish.adminPort>4848</cargo.glassfish.adminPort>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<type>war</type>
</deployable>
</deployables>
</configuration>
<dependencies>
<dependency>
<groupId>org.glassfish.main.deployment</groupId>
<artifactId>deployment-client</artifactId>
<version>3.1.2.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
你是指“热”模式到底是什么意思? – 2010-07-29 08:39:26
GlassFish正在运行,域已启动,应用程序已经存在。我们只需要重新发送它。 GlassFish将重新部署它。 – yegor256 2010-07-29 10:06:13