2

我是否从该页面了解 Cargo Maven 插件不支持对 GlassFish 3.x 的热远程部署?如果我错了,我该如何配置它以支持这种类型的操作?

也许我应该使用其他插件?我想通过 HTTP 以“热”模式部署到 GlassFish 远程安装。

4

2 回答 2

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 插件执行相同的任务?

于 2010-08-02T15:38:46.410 回答
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>
于 2013-09-03T08:49:37.053 回答