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
Consolidate Maven plugin documentation in plugin reference
This commit moves Maven plugin content from several sections in the
main Spring Boot reference documentation to the plugin-specific
documentation.
Fixesgh-19165
If you do not include the `<execution/>` configuration, as shown in the prior example, you can run the plugin on its own (but only if the package goal is used as well), as shown in the following example:
If you use a milestone or snapshot release, you also need to add the appropriate `pluginRepository` elements, as shown in the following listing:
75
-
76
-
[source,xml,indent=0,subs="verbatim,attributes"]
77
-
----
78
-
<pluginRepositories>
79
-
<pluginRepository>
80
-
<id>spring-snapshots</id>
81
-
<url>https://repo.spring.io/snapshot</url>
82
-
</pluginRepository>
83
-
<pluginRepository>
84
-
<id>spring-milestones</id>
85
-
<url>https://repo.spring.io/milestone</url>
86
-
</pluginRepository>
87
-
</pluginRepositories>
88
-
----
89
-
90
-
91
-
92
-
[[build-tool-plugins-maven-packaging]]
93
-
=== Packaging Executable Jar and War Files
94
-
Once `spring-boot-maven-plugin` has been included in your `pom.xml`, it automatically tries to rewrite archives to make them executable by using the `spring-boot:repackage` goal.
95
-
You should configure your project to build a jar or war (as appropriate) by using the usual `packaging` element, as shown in the following example:
Your existing archive is enhanced by Spring Boot during the `package` phase.
109
-
The main class that you want to launch can be specified either by using a configuration option, as shown below, or by adding a `Main-Class` attribute to the manifest.
110
-
If you do not specify a main class, the plugin searches for a class with a `public static void main(String[] args)` method.
111
-
112
-
[source,xml,indent=0,subs="verbatim,attributes"]
113
-
----
114
-
<plugin>
115
-
<groupId>org.springframework.boot</groupId>
116
-
<artifactId>spring-boot-maven-plugin</artifactId>
117
-
<configuration>
118
-
<mainClass>com.example.app.Main</mainClass>
119
-
</configuration>
120
-
</plugin>
121
-
----
122
-
123
-
124
-
To build and run a project artifact, you can type the following:
125
-
126
-
[indent=0]
127
-
----
128
-
$ mvn package
129
-
$ java -jar target/mymodule-0.0.1-SNAPSHOT.jar
130
-
----
131
-
132
-
To build a war file that is both executable and deployable into an external container, you need to mark the embedded container dependencies as "`provided`", as shown in the following example:
TIP: See the "`<<howto.adoc#howto-create-a-deployable-war-file>>`" section for more details on how to create a deployable war file.
158
-
159
-
Advanced configuration options and examples are available in the {spring-boot-maven-plugin-docs}[plugin info page].
160
-
161
-
162
-
163
23
[[build-tool-plugins-gradle-plugin]]
164
24
== Spring Boot Gradle Plugin
165
25
The Spring Boot Gradle Plugin provides Spring Boot support in Gradle, letting you package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started.adoc
+1-82Lines changed: 1 addition & 82 deletions
Original file line number
Diff line number
Diff line change
@@ -108,88 +108,7 @@ Spring Boot dependencies use the `org.springframework.boot` `groupId`.
108
108
Typically, your Maven POM file inherits from the `spring-boot-starter-parent` project and declares dependencies to one or more <<using-spring-boot.adoc#using-boot-starter,"`Starters`">>.
109
109
Spring Boot also provides an optional <<build-tool-plugins.adoc#build-tool-plugins-maven-plugin, Maven plugin>> to create executable jars.
110
110
111
-
The following listing shows a typical `pom.xml` file:
<!-- (you don't need this if you are using a .RELEASE version) -->
165
-
<repositories>
166
-
<repository>
167
-
<id>spring-snapshots</id>
168
-
<url>https://repo.spring.io/snapshot</url>
169
-
<snapshots><enabled>true</enabled></snapshots>
170
-
</repository>
171
-
<repository>
172
-
<id>spring-milestones</id>
173
-
<url>https://repo.spring.io/milestone</url>
174
-
</repository>
175
-
</repositories>
176
-
<pluginRepositories>
177
-
<pluginRepository>
178
-
<id>spring-snapshots</id>
179
-
<url>https://repo.spring.io/snapshot</url>
180
-
</pluginRepository>
181
-
<pluginRepository>
182
-
<id>spring-milestones</id>
183
-
<url>https://repo.spring.io/milestone</url>
184
-
</pluginRepository>
185
-
</pluginRepositories>
186
-
endif::[]
187
-
</project>
188
-
----
189
-
190
-
TIP: The `spring-boot-starter-parent` is a great way to use Spring Boot, but it might not be suitable all of the time.
191
-
Sometimes you may need to inherit from a different parent POM, or you might not like our default settings.
192
-
In those cases, see <<using-spring-boot.adoc#using-boot-maven-without-a-parent>> for an alternative solution that uses an `import` scope.
111
+
More details on getting started with Spring Boot and Maven can be found in the {spring-boot-maven-plugin-docs}/#getting-started[Getting Started section] of the Maven plugin's reference guide.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc
+5-14Lines changed: 5 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -2440,23 +2440,14 @@ Using this format lets the time be parsed into a `Date` and its format, when ser
2440
2440
2441
2441
[[howto-customize-dependency-versions]]
2442
2442
=== Customize Dependency Versions
2443
-
If you use a Maven build that inherits directly or indirectly from `spring-boot-dependencies` (for instance, `spring-boot-starter-parent`) but you want to override a specific third-party dependency, you can add appropriate `<properties>` elements.
2444
-
Browse the <<appendix-dependency-versions.adoc#dependency-versions-properties, `Version properties`>> for a complete list of version properties.
2445
-
For example, to pick a different `slf4j` version, you would add the following property:
NOTE: Doing so only works if your Maven project inherits (directly or indirectly) from `spring-boot-dependencies`.
2455
-
If you have added `spring-boot-dependencies` in your own `dependencyManagement` section with `<scope>import</scope>`, you have to redefine the artifact yourself instead of overriding the property.
2443
+
The `spring-boot-dependencies` POM manages the versions of common dependencies.
2444
+
The Spring Boot plugins for Maven and Gradle allow these managed dependency versions to be customized using build properties.
2456
2445
2457
2446
WARNING: Each Spring Boot release is designed and tested against this specific set of third-party dependencies.
2458
2447
Overriding versions may cause compatibility issues.
2459
2448
2449
+
To override dependency versions with Maven, see {spring-boot-maven-plugin-docs}/#using[this section] of the Maven plugin's documentation.
2450
+
2460
2451
To override dependency versions in Gradle, see {spring-boot-gradle-plugin-docs}/#managing-dependencies-customizing[this section] of the Gradle plugin's documentation.
2461
2452
2462
2453
@@ -2501,7 +2492,7 @@ However, you must additionally add an `<executions>` section, as follows:
2501
2492
</build>
2502
2493
----
2503
2494
2504
-
See the {spring-boot-maven-plugin-docs}#getting-started[plugin documentation] for full usage details.
2495
+
See the {spring-boot-maven-plugin-docs}#repackage[plugin documentation] for full usage details.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/index.htmladoc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
[[spring-boot-reference-documentation]]
2
2
= Spring Boot Reference Documentation
3
-
Phillip Webb, Dave Syer, Josh Long, Stéphane Nicoll, Rob Winch, Andy Wilkinson, Marcel Overdijk, Christian Dupuis, Sébastien Deleuze, Michael Simons, Vedran Pavić, Jay Bryant, Madhura Bhave, Eddú Meléndez
3
+
Phillip Webb, Dave Syer, Josh Long, Stéphane Nicoll, Rob Winch, Andy Wilkinson, Marcel Overdijk, Christian Dupuis, Sébastien Deleuze, Michael Simons, Vedran Pavić, Jay Bryant, Madhura Bhave, Eddú Meléndez, Scott Frederick
4
4
:docinfo: shared
5
5
6
6
The reference documentation consists of the following sections:
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/index.htmlsingleadoc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
[[spring-boot-reference-documentation]]
2
2
= Spring Boot Reference Documentation
3
-
Phillip Webb, Dave Syer, Josh Long, Stéphane Nicoll, Rob Winch, Andy Wilkinson, Marcel Overdijk, Christian Dupuis, Sébastien Deleuze, Michael Simons, Vedran Pavić, Jay Bryant, Madhura Bhave
3
+
Phillip Webb, Dave Syer, Josh Long, Stéphane Nicoll, Rob Winch, Andy Wilkinson, Marcel Overdijk, Christian Dupuis, Sébastien Deleuze, Michael Simons, Vedran Pavić, Jay Bryant, Madhura Bhave, Eddú Meléndez, Scott Frederick
0 commit comments