我想将我的战争上传到两个单独的位置。为此,我在 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