简体   繁体   English

如何使用cargo Maven插件在两个不同的glassfish域上进行部署?

[英]How to deploy on two different glassfish domains with cargo maven plugin?

I'm trying to deploy my application on 2 different glassfish domains on the same server. 我试图将我的应用程序部署在同一服务器上的2个不同的glassfish域上。 One is called localhost-domain1, second is localhost-domain2. 一个称为localhost-domain1,第二个称为localhost-domain2。 All my deploys go into localhost-domain1(but at least those deploy successfully). 我所有的部署都进入了localhost-domain1(但至少部署成功了)。

To setup it I made 2 profiles in my POM.xml 要设置它,我在POM.xml中创建了2个配置文件

<profile>
        <id>continousIntegrationA</id>
        <build>
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                </resource>
                <resource>
                    <directory>src/main/webapp</directory>
                </resource>
            </resources>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.cargo</groupId>
                    <artifactId>cargo-maven2-plugin</artifactId>
                    <version>1.4.5</version>
                    <configuration>
                        <container>
                            <containerId>glassfish4x</containerId>
                            <type>remote</type>
                        </container>
                        <configuration>
                            <type>runtime</type>
                            <properties>
                                <cargo.hostname>*censored*</cargo.hostname>
                                <cargo.remote.username>*censored*</cargo.remote.username>
                                <cargo.remote.password>*censored*</cargo.remote.password>
                                <cargo.remote.port>4848</cargo.remote.port>
                                <cargo.glassfish.domain.name>localhost-domain1</cargo.glassfish.domain.name>
                            </properties>
                        </configuration>
                        <deployables>
                            <deployable>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>${project.artifactId}</artifactId>
                                <type>war</type>
                                <properties>
                                    <context>${project.name}</context>
                                </properties>
                            </deployable>
                        </deployables>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.glassfish.deployment</groupId>
                            <artifactId>deployment-client</artifactId>
                            <version>3.2-b06</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </build>
    </profile>
    <profile>
        <id>continousIntegrationB</id>
        <build>
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                </resource>
                <resource>
                    <directory>src/main/webapp</directory>
                </resource>
            </resources>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.cargo</groupId>
                    <artifactId>cargo-maven2-plugin</artifactId>
                    <version>1.4.5</version>
                    <configuration>
                        <container>
                            <containerId>glassfish4x</containerId>
                            <type>remote</type>
                        </container>
                        <configuration>
                            <type>runtime</type>
                            <properties>
                                <cargo.hostname>*censored*</cargo.hostname>
                                <cargo.remote.username>*censored*</cargo.remote.username>
                                <cargo.remote.password>*censored*</cargo.remote.password>
                                <cargo.remote.port>4949</cargo.remote.port>
                                <cargo.glassfish.domain.name>localhost-domain2</cargo.glassfish.domain.name>
                            </properties>
                        </configuration>
                        <deployables>
                            <deployable>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>${project.artifactId}</artifactId>
                                <type>war</type>
                                <properties>
                                    <context>${project.name}</context>
                                </properties>
                            </deployable>
                        </deployables>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.glassfish.deployment</groupId>
                            <artifactId>deployment-client</artifactId>
                            <version>3.2-b06</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </build>
    </profile>

Then I deploy with desired profile, yet both profiles deploy into localhost-domain1. 然后,我使用所需的配置文件进行部署,但两个配置文件均部署到localhost-domain1中。

The problem was with cargo.remote.port. 问题出在cargo.remote.port。 It should actually be cargo.glassfish.admin.port. 它实际上应该是cargo.glassfish.admin.port。 Changing name of that property fixed everything. 更改该属性的名称可以修复所有问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Cargo maven插件将EAR远程部署到JBoss 5.1.0.GA? - How to deploy remotely EAR to JBoss 5.1.0.GA using Cargo maven plugin? 使用cargo Maven插件将Spring项目部署到远程服务器 - using cargo maven plugin to deploy spring project to remote server 如何将Maven项目热部署到glassfish? - How to hot deploy maven project to glassfish? 未能在项目 duke 辅导上执行目标 org.codehaus.cargo:cargo-maven2-plugin:1.4.4:redeploy (deploy) - Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.4:redeploy (deploy) on project duke tutoring 如何正确设置 tomcat 日志到 Maven Cargo Plugin - How properly to set up tomcat logs into Maven Cargo Plugin 如何指定core.cargo.version在cargo-maven2-plugin中使用 - How to specify core.cargo.version to use in cargo-maven2-plugin 如何使用Maven Cargo在Glassfish中设置配置(JDBC领域或Java邮件会话)? - How to setup configuration (JDBC Realm or a Java Mail Session) in Glassfish with Maven Cargo? 由maven部署JavaEE 8教程失败,无法在项目hello1上执行目标org.codehaus.cargo:cargo-maven2-plugin:1.6.4:redeploy(deploy) - Deploying the JavaEE 8 Tutorial, by maven gets Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.6.4:redeploy (deploy) on project hello1 如何在CloudBees上部署Glassfish Maven应用程序? - How can I deploy Glassfish Maven app on CloudBees? 无法使用Grago的Cargo插件在本地部署 - Cannot deploy locally using Cargo plugin for Gradle
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM