我想把我的战争上传到两个sepearet位置。为此,我在我的pom.xml中定义了以下配置文件;
........
<profile>
<id>deployPoc</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<jboss.host>POC_Deploy</jboss.host>
<jboss.deployDir>/storage2/home/server1/</jboss.deployDir>
<jboss.deployUrl>scp://server1.com</jboss.deployUrl>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-upload-plugin</artifactId>
<version>1.1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
<configuration>
<resourceSrc>
${project.build.directory}/${project.build.finalName}.${project.packaging}
</resourceSrc>
<resourceDest>${jboss.deployDir}</resourceDest>
<serverId>${jboss.host}</serverId>
<url>${jboss.deployUrl}</url>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>uploadUpdate</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<updateReleaseHost>PluginReleaseSite</updateReleaseHost>
<updateReleaseDir>/var/www/html/releases/Latest/</updateReleaseDir>
<updateReleaseUrl>scp://server2.com</updateReleaseUrl>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-upload-plugin</artifactId>
<version>1.1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
<configuration>
<resourceSrc>
${project.build.directory}/${project.build.finalName}.${project.packaging}
</resourceSrc>
<resourceDest>${updateReleaseDir}</resourceDest>
<serverId>${updateReleaseHost}</serverId>
<url>${updateReleaseUrl}</url>
</configuration>
</plugin>
</plugins>
</build>
</profile>
我试图使用以下命令执行这两个命令,并且只执行其中一个命令;
mvn help:active-profiles upload:upload -PdeployPoc -PuploadUpdate
它只执行'uploadUpdate',我尝试了所有的东西,即-Pa,b; -P a,b等等。
虽然maven节目如下,但似乎没有任何效果;
The following profiles are active:
- releaseRepository (source: external)
- snapshotsRepository (source: external)
- deployPoc (source: com.Project:1.0-SNAPSHOT)
- uploadUpdate (source: com.Project:1.0-SNAPSHOT)
我错过了什么吗?
谢谢,
-
SJunejo
答案 0 :(得分:5)
根据您使用相同插件的配置文件,这意味着您具有相同的执行,这意味着相同的执行ID,在您的情况下是相同的。
我建议使用具有不同Id的显式执行。
除了上述内容之外,我建议使用jboss plugin部署到不是Maven预期方法的应用服务器。