Merge branch '2.3.x'

Closes gh-23718
pull/23728/head
Stephane Nicoll 4 years ago
commit 2916bb4c10

@ -35,7 +35,8 @@ It also allows you to add an arbitrary number of additional properties, as shown
----
This configuration will generate a `build-info.properties` at the expected location with four additional keys.
Note that `maven.compiler.source` and `maven.compiler.target` are expected to be regular properties available in the project.
NOTE: `maven.compiler.source` and `maven.compiler.target` are expected to be regular properties available in the project.
They will be interpolated as you would expect.
include::goals/build-info.adoc[leveloffset=+1]

@ -302,7 +302,7 @@ You can take control over the name, as shown in the following example:
</project>
----
Note that this configuration does not provide an explicit tag so `latest` is used.
NOTE: This configuration does not provide an explicit tag so `latest` is used.
It is possible to specify a tag as well, either using `${project.version}`, any property available in the build or a hardcoded version.
The image name can be specified on the command line as well, as shown in this example:

@ -77,7 +77,8 @@ For more details, see <<repackage-example-exclude-dependency,the dedicated examp
Sometimes it is useful to include test dependencies when running the application.
For example, if you want to run your application in a test mode that uses stub classes.
If you wish to do this, you can set the `useTestClasspath` parameter to true.
Note that this is only applied when you run an application: the `repackage` goal will not add test dependencies to the resulting JAR/WAR.
NOTE: This is only applied when you run an application: the `repackage` goal will not add test dependencies to the resulting JAR/WAR.
include::goals/run.adoc[leveloffset=+1]

@ -12,7 +12,7 @@ This dependency management lets you omit `<version>` tags for those dependencies
* Sensible plugin configuration (https://github.com/ktoso/maven-git-commit-id-plugin[Git commit ID], and https://maven.apache.org/plugins/maven-shade-plugin/[shade]).
* Sensible resource filtering for `application.properties` and `application.yml` including profile-specific files (for example, `application-dev.properties` and `application-dev.yml`)
Note that, since the `application.properties` and `application.yml` files accept Spring style placeholders (`${...}`), the Maven filtering is changed to use `@..@` placeholders.
NOTE: Since the `application.properties` and `application.yml` files accept Spring style placeholders (`${...}`), the Maven filtering is changed to use `@..@` placeholders.
(You can override that by setting a Maven property called `resource.delimiter`.)
@ -106,3 +106,45 @@ For instance, to use a different version of the SLF4J library and the Spring Dat
----
[[using-overriding-command-line]]
=== Overriding settings on the command-line
The plugin offers a number of user properties, starting with `spring-boot`, to let you customize the configuration from the command-line.
For instance, you could tune the profiles to enable when running the application as follows:
[indent=0]
----
$ mvn spring-boot:run -Dspring-boot.run.profiles=dev,local
----
If you want to both have a default while allowing it to be overridden on the command-line, you should use a combination of a user-provided project property and MOJO configuration.
[source,xml,indent=0,subs="verbatim,attributes"]
----
<project>
<properties>
<app.profiles>local,dev</app.profiles>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>{gradle-project-version}</version>
<configuration>
<profiles>${app.profiles}</profiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
----
The above makes sure that `local` and `dev` are enabled by default.
Now a dedicated property has been exposed, this can be overridden on the command-line as well:
[indent=0]
----
$ mvn spring-boot:run -Dapp.profiles=test
----

Loading…
Cancel
Save