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

发布于 2024-09-11 13:50:00 字数 216 浏览 4 评论 0原文

我是否从 此页面中正确理解 Cargo Maven 插件不支持热远程部署到 GlassFish 3.x?如果我错了,我该如何配置它来支持此类操作?

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

Did I understand right from this page that Cargo Maven plugin doesn't support hot remote deployment to GlassFish 3.x? If I'm wrong, how can I configure it to support such type of operation?

Maybe I should use some other plugin? I'd like to deploy to GlassFish remote installation, through HTTP, in "hot" mode.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

近箐 2024-09-18 13:50:01

这能回答你的问题吗?

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

Does this answer your question?

<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>
打小就很酷 2024-09-18 13:50:00

这就是我到目前为止所做的:

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

This is what I've done so far:

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

Works perfectly, but asadmin (and the entire GlassFish, I assume) has to be installed on the same machine where mvn is executed.

Is it possible to perform the same task with Cargo plugin?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文