[英]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.