...
| Code Block | ||
|---|---|---|
| ||
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>some.plugin.group</groupId>
<artifactId>my-maven-plugin</artifactId>
<executions>
<execution>
<id>test-1</id>
<phase>test</phase>
<goals>
<goal>do-stuff</goal>
</goals>
<configuration>
<param>value</param>
</configuration>
</execution>
<execution>
<id>test-2</id>
<phase>test</phase>
<goals>
<goal>do-stuff</goal>
</goals>
<configuration>
<param>value2</param>
</configuration>
</execution>
<execution>
<id>test-n</id>
<phase>test</phase>
<goals>
<goal>do-stuff</goal>
</goals>
<configuration>
<param>valueN</param>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>deploy-optional</id>
<build>
<plugins>
<plugin>
<groupId>some.plugin.group</groupId>
<artifactId>my-maven-plugin</artifactId>
<executions>
<execution>
<id>deploy-1</id>
<phase>deploy</phase>
<goals>
<goal>do-stuff</goal>
</goals>
<configuration>
<param>value-deploy</param>
</configuration>
</execution>
<execution>
<id>deploy-2</id>
<phase>deploy</phase>
<goals>
<goal>do-stuff</goal>
</goals>
<configuration>
<param>value-deploy-2</param>
</configuration>
</execution>
<execution>
<id>deploy-n</id>
<phase>deploy</phase>
<goals>
<goal>do-stuff</goal>
</goals>
<configuration>
<param>value-deploy-N</param>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
|
Run It!
Under normal circumstances, you don't want the optional deployment bindings to execute, so you simply use:
| No Format |
|---|
mvn deploy
{noformat|
|
However,
...
in
...
some
...
cases,
...
you
...
want
...
to
...
run
...
the
...
extra
...
deploy-phase
...
mojo
...
bindings.
...
To
...
do
...
this,
...
run:
| No Format |
|---|
mvn |
...
\-P deploy-optional deploy |
| No Format |
|---|
