Polish "Extract XML examples from Maven plugin adoc files"

See gh-25534
pull/25873/head
Scott Frederick 4 years ago
parent 4e287594bf
commit 5595fb2423

@ -23,15 +23,9 @@ Spring Boot's Parent POM, `spring-boot-starter-parent`, configures Failsafe's `<
Without this configuration, which causes Failsafe to use the compiled classes rather than the repackaged jar, Failsafe cannot load your application's classes. Without this configuration, which causes Failsafe to use the compiled classes rather than the repackaged jar, Failsafe cannot load your application's classes.
If you are not using the parent POM, you should configure Failsafe in the same way, as shown in the following example: If you are not using the parent POM, you should configure Failsafe in the same way, as shown in the following example:
[source,xml,indent=0,subs="verbatim,attributes"] [source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
---- ----
<plugin> include::../maven/integration-tests/failsafe-pom.xml[tags=failsafe]
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
</configuration>
</plugin>
---- ----
include::goals/start.adoc[leveloffset=+1] include::goals/start.adoc[leveloffset=+1]

@ -169,7 +169,7 @@ Again, if you are using `spring-boot-starter-parent`, this can be simplified as
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] [source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
---- ----
include::../maven/packaging/classified-artifact-pom.xml[tags=classified-artifact] include::../maven/packaging/jar-plugin-first-pom.xml[tags=jar-plugin-first]
---- ----
@ -231,14 +231,14 @@ There are two ways one can exclude a dependency from being packaged/used at runt
* Exclude a specific artifact identified by `groupId` and `artifactId`, optionally with a `classifier` if needed. * Exclude a specific artifact identified by `groupId` and `artifactId`, optionally with a `classifier` if needed.
* Exclude any artifact belonging to a given `groupId`. * Exclude any artifact belonging to a given `groupId`.
The following example excludes `com.foo:bar`, and only that artifact: The following example excludes `com.example:module1`, and only that artifact:
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] [source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
---- ----
include::../maven/packaging/exclude-artifact-pom.xml[tags=exclude-artifact] include::../maven/packaging/exclude-artifact-pom.xml[tags=exclude-artifact]
---- ----
This example excludes any artifact belonging to the `com.foo` group: This example excludes any artifact belonging to the `com.example` group:
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] [source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
---- ----

@ -163,7 +163,7 @@ In the following example, two arguments are available: `property1` and `property
==== Specify Active Profiles ==== Specify Active Profiles
The active profiles to use for a particular application can be specified using the `profiles` argument. The active profiles to use for a particular application can be specified using the `profiles` argument.
The following configuration enables the `foo` and `bar` profiles: The following configuration enables the `local` and `dev` profiles:
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4] [source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
---- ----
@ -174,7 +174,7 @@ The profiles to enable can be specified on the command line as well, make sure t
[indent=0] [indent=0]
---- ----
$ mvn spring-boot:run -Dspring-boot.run.profiles=foo,bar $ mvn spring-boot:run -Dspring-boot.run.profiles=local,dev
---- ----

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<artifactId>integration-tests</artifactId>
<build>
<plugins>
<!-- tag::failsafe[] -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
</configuration>
</plugin>
<!-- end::failsafe[] -->
</plugins>
</build>
</project>

@ -7,7 +7,7 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<configuration> <configuration>
<excludeGroupIds>com.foo</excludeGroupIds> <excludeGroupIds>com.example</excludeGroupIds>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

@ -9,8 +9,8 @@
<configuration> <configuration>
<excludes> <excludes>
<exclude> <exclude>
<groupId>com.foo</groupId> <groupId>com.example</groupId>
<artifactId>bar</artifactId> <artifactId>module1</artifactId>
</exclude> </exclude>
</excludes> </excludes>
</configuration> </configuration>

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- tag::classified-artifact[] --> <!-- tag::jar-plugin-first[] -->
<project> <project>
<build> <build>
<plugins> <plugins>
@ -30,5 +30,5 @@
</plugins> </plugins>
</build> </build>
</project> </project>
<!-- end::classified-artifact[] --> <!-- end::jar-plugin-first[] -->

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- tag::repackage[] -->
<project> <project>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>packaging</artifactId> <artifactId>packaging</artifactId>
<!-- ... --> <!-- ... -->
<!-- tag::repackage[] -->
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
@ -19,6 +19,5 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project>
<!-- end::repackage[] --> <!-- end::repackage[] -->
</project>

@ -8,8 +8,8 @@
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<configuration> <configuration>
<profiles> <profiles>
<profile>foo</profile> <profile>local</profile>
<profile>bar</profile> <profile>dev</profile>
</profiles> </profiles>
</configuration> </configuration>
</plugin> </plugin>

Loading…
Cancel
Save