mvn install -P Profile-Download-Extra-Resources
Under below pom, Profile-Download-Extra-Resources
is activated by default.
mvn install -P '!Profile-Download-Extra-Resources'
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.oldratlee.demo</groupId>
<artifactId>war-resources-demo</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>${artifactId}</name>
<dependencies>
</dependencies>
<profiles>
<profile>
<id>Profile-Download-Extra-Resources</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<executions>
<execution>
<id>download-file</id>
<phase>prepare-package</phase>
<goals>
<goal>download-single</goal>
</goals>
<configuration>
<url>http://foo.com/</url>
<fromFile><![CDATA[foo.tgz?AccessKeyId=xx&Expires=1998305368]]></fromFile>
<toFile>${project.build.directory}/extra-resources/foo.tgz</toFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<!-- this is relative to the pom.xml directory -->
<directory>
${project.build.directory}/extra-resources
</directory>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>