[英]How to deploy remotely EAR to JBoss 5.1.0.GA using Cargo maven plugin?
[英]How to deploy on two different glassfish domains with cargo maven plugin?
我試圖將我的應用程序部署在同一服務器上的2個不同的glassfish域上。 一個稱為localhost-domain1,第二個稱為localhost-domain2。 我所有的部署都進入了localhost-domain1(但至少部署成功了)。
要設置它,我在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>
然后,我使用所需的配置文件進行部署,但兩個配置文件均部署到localhost-domain1中。
問題出在cargo.remote.port。 它實際上應該是cargo.glassfish.admin.port。 更改該屬性的名稱可以修復所有問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.