我是否理解this page来自Cargo Maven插件不支持对GlassFish 3.x进行热远程部署?如果我错了,我如何配置它以支持这种类型的操作?
也许我应该使用其他一些插件?我想通过HTTP以“热”模式部署到GlassFish远程安装。
答案 0 :(得分:0)
这是我到目前为止所做的:
<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插件执行相同的任务?
答案 1 :(得分:0)
这会回答你的问题吗?
<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>