You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/using.adoc
+43-1Lines changed: 43 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ This dependency management lets you omit `<version>` tags for those dependencies
12
12
* 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]).
13
13
* Sensible resource filtering for `application.properties` and `application.yml` including profile-specific files (for example, `application-dev.properties` and `application-dev.yml`)
14
14
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.
16
16
(You can override that by setting a Maven property called `resource.delimiter`.)
17
17
18
18
@@ -106,3 +106,45 @@ For instance, to use a different version of the SLF4J library and the Spring Dat
106
106
----
107
107
108
108
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:
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:
0 commit comments