mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Expose skip property consistently
This commit makes sure that the `skip` command-line property can be used for all goals of the maven plugin. A dedicated sample for integration tests has also been added as this change may confuse users, especially those who wish to skip a certain goal and not the plugin execution altogether. Closes gh-7313
This commit is contained in:
parent
0befc310cd
commit
6e79521fff
@ -167,7 +167,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
|
||||
* Skip the execution.
|
||||
* @since 1.3.2
|
||||
*/
|
||||
@Parameter(defaultValue = "false")
|
||||
@Parameter(property = "skip", defaultValue = "false")
|
||||
private boolean skip;
|
||||
|
||||
@Override
|
||||
|
@ -75,7 +75,7 @@ public class StopMojo extends AbstractMojo {
|
||||
* Skip the execution.
|
||||
* @since 1.3.2
|
||||
*/
|
||||
@Parameter(defaultValue = "false")
|
||||
@Parameter(property = "skip", defaultValue = "false")
|
||||
private boolean skip;
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,63 @@
|
||||
-----
|
||||
Skip integration tests
|
||||
-----
|
||||
Stephane Nicoll
|
||||
-----
|
||||
2016-11-25
|
||||
-----
|
||||
|
||||
The <<<skip>>> property allows to skip the execution of the Spring Boot maven plugin
|
||||
altogether. This example shows how you can skip integration tests with a command-line
|
||||
property and still make sure that the <<repackage>> goal runs:
|
||||
|
||||
---
|
||||
<project>
|
||||
<properties>
|
||||
<skip.it>false</skip.it>
|
||||
...
|
||||
</properties>
|
||||
...
|
||||
<build>
|
||||
...
|
||||
<plugins>
|
||||
...
|
||||
<plugin>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>pre-integration-test</id>
|
||||
<goals>
|
||||
<goal>start</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<skip>${skip.it}</skip>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>post-integration-test</id>
|
||||
<goals>
|
||||
<goal>stop</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<skip>${skip.it}</skip>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>${skip.it}</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
...
|
||||
</plugins>
|
||||
...
|
||||
</build>
|
||||
---
|
||||
|
||||
By default, the integration tests will run but this setup allows you to easily disable
|
||||
them on the command-line as follows: <<<mvn verify -Dskip.it=true>>>.
|
@ -54,6 +54,8 @@ Spring Boot Maven Plugin
|
||||
|
||||
* {{{./examples/it-random-port.html}Random port for integration tests}}
|
||||
|
||||
* {{{./examples/it-skip.html}Skip integration tests}}
|
||||
|
||||
* {{{./examples/run-profiles.html}Specify active profiles}}
|
||||
|
||||
* {{{./examples/build-info.html}Generate build information}}
|
||||
|
@ -12,6 +12,7 @@
|
||||
<item name="Exclude a dependency" href="examples/exclude-dependency.html"/>
|
||||
<item name="Debug the application" href="examples/run-debug.html"/>
|
||||
<item name="Random port for integration tests" href="examples/it-random-port.html"/>
|
||||
<item name="Skip integration tests" href="examples/it-skip.html"/>
|
||||
<item name="Specify active profiles" href="examples/run-profiles.html"/>
|
||||
<item name="Generate build information" href="examples/build-info.html"/>
|
||||
</menu>
|
||||
|
Loading…
Reference in New Issue
Block a user