Skip to content

Commit 2916bb4

Browse files
committed
Merge branch '2.3.x'
Closes gh-23718
2 parents bc7b6bd + 6beb0c9 commit 2916bb4

File tree

4 files changed

+48
-4
lines changed

4 files changed

+48
-4
lines changed

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/build-info.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ It also allows you to add an arbitrary number of additional properties, as shown
3535
----
3636

3737
This configuration will generate a `build-info.properties` at the expected location with four additional keys.
38-
Note that `maven.compiler.source` and `maven.compiler.target` are expected to be regular properties available in the project.
38+
39+
NOTE: `maven.compiler.source` and `maven.compiler.target` are expected to be regular properties available in the project.
3940
They will be interpolated as you would expect.
4041

4142
include::goals/build-info.adoc[leveloffset=+1]

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ You can take control over the name, as shown in the following example:
302302
</project>
303303
----
304304

305-
Note that this configuration does not provide an explicit tag so `latest` is used.
305+
NOTE: This configuration does not provide an explicit tag so `latest` is used.
306306
It is possible to specify a tag as well, either using `${project.version}`, any property available in the build or a hardcoded version.
307307

308308
The image name can be specified on the command line as well, as shown in this example:

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/running.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ For more details, see <<repackage-example-exclude-dependency,the dedicated examp
7777
Sometimes it is useful to include test dependencies when running the application.
7878
For example, if you want to run your application in a test mode that uses stub classes.
7979
If you wish to do this, you can set the `useTestClasspath` parameter to true.
80-
Note that this is only applied when you run an application: the `repackage` goal will not add test dependencies to the resulting JAR/WAR.
80+
81+
NOTE: This is only applied when you run an application: the `repackage` goal will not add test dependencies to the resulting JAR/WAR.
8182

8283
include::goals/run.adoc[leveloffset=+1]
8384

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/using.adoc

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This dependency management lets you omit `<version>` tags for those dependencies
1212
* 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]).
1313
* Sensible resource filtering for `application.properties` and `application.yml` including profile-specific files (for example, `application-dev.properties` and `application-dev.yml`)
1414

15-
Note that, since the `application.properties` and `application.yml` files accept Spring style placeholders (`${...}`), the Maven filtering is changed to use `@..@` placeholders.
15+
NOTE: Since the `application.properties` and `application.yml` files accept Spring style placeholders (`${...}`), the Maven filtering is changed to use `@..@` placeholders.
1616
(You can override that by setting a Maven property called `resource.delimiter`.)
1717

1818

@@ -106,3 +106,45 @@ For instance, to use a different version of the SLF4J library and the Spring Dat
106106
----
107107

108108

109+
110+
[[using-overriding-command-line]]
111+
=== Overriding settings on the command-line
112+
The plugin offers a number of user properties, starting with `spring-boot`, to let you customize the configuration from the command-line.
113+
114+
For instance, you could tune the profiles to enable when running the application as follows:
115+
116+
[indent=0]
117+
----
118+
$ mvn spring-boot:run -Dspring-boot.run.profiles=dev,local
119+
----
120+
121+
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.
122+
123+
[source,xml,indent=0,subs="verbatim,attributes"]
124+
----
125+
<project>
126+
<properties>
127+
<app.profiles>local,dev</app.profiles>
128+
</properties>
129+
<build>
130+
<plugins>
131+
<plugin>
132+
<groupId>org.springframework.boot</groupId>
133+
<artifactId>spring-boot-maven-plugin</artifactId>
134+
<version>{gradle-project-version}</version>
135+
<configuration>
136+
<profiles>${app.profiles}</profiles>
137+
</configuration>
138+
</plugin>
139+
</plugins>
140+
</build>
141+
</project>
142+
----
143+
144+
The above makes sure that `local` and `dev` are enabled by default.
145+
Now a dedicated property has been exposed, this can be overridden on the command-line as well:
146+
147+
[indent=0]
148+
----
149+
$ mvn spring-boot:run -Dapp.profiles=test
150+
----

0 commit comments

Comments
 (0)