Maven 2 使用cargo-maven2-plugin热部署到GlassFish,如何配置?

Maven 2 使用cargo-maven2-plugin热部署到GlassFish,如何配置?,maven-2,glassfish,maven-cargo,Maven 2,Glassfish,Maven Cargo,我从Cargo Maven插件不支持GlassFish 3.x的热远程部署中了解到了吗?如果我错了,我如何配置它来支持这种类型的操作 也许我应该使用其他插件?我想通过HTTP在“热”模式下部署到GlassFish远程安装。这是我迄今为止所做的: <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.4</version> <executions

我从Cargo Maven插件不支持GlassFish 3.x的热远程部署中了解到了吗?如果我错了,我如何配置它来支持这种类型的操作


也许我应该使用其他插件?我想通过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>

maven antrun插件
1.4
包裹
跑
工作正常,但是
asadmin
(我假设整个GlassFish)必须安装在执行
mvn
的同一台机器上


是否可以使用Cargo plugin执行相同的任务?

这就是我目前所做的:

<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>

maven antrun插件
1.4
包裹
跑
工作正常,但是
asadmin
(我假设整个GlassFish)必须安装在执行
mvn
的同一台机器上


Cargo plugin是否可以执行相同的任务?

这是否回答了您的问题

<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>

org.codehaus.cargo
cargo-maven2-plugin
玻璃鱼3X
遥远的
运行时
dev-server-01
8080
用户
通过
域名
4848
${project.groupId}
${project.artifactId}
战争
org.glassfish.main.deployment
部署客户端
3.1.2.2

这是否回答了您的问题

<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>

org.codehaus.cargo
cargo-maven2-plugin
玻璃鱼3X
遥远的
运行时
dev-server-01
8080
用户
通过
域名
4848
${project.groupId}
${project.artifactId}
战争
org.glassfish.main.deployment
部署客户端
3.1.2.2

您所说的“热”模式到底是什么意思?GlassFish正在工作,域已经启动,应用程序已经存在。我们只需要重新发送它。GlassFish将重新部署它。你所说的“热”模式到底是什么意思?GlassFish正在工作,域已经启动,应用程序已经存在。我们只需要重新发送它。GlassFish将重新部署它。