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/index.adoc
+10-13Lines changed: 10 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -20,25 +20,22 @@ Stephane Nicoll, Andy Wilkinson, Scott Frederick
20
20
21
21
22
22
23
-
[[introduction]]
24
-
== Introduction
25
-
The Spring Boot Maven Plugin provides Spring Boot support in https://maven.org[Apache Maven].
26
-
It allows you to package executable jar or war archives, run Spring Boot applications, generate build information and start your Spring Boot application prior to running integration tests.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/integration-tests.adoc
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
[[integration-tests]]
2
-
==Running Integration Tests
2
+
= Running Integration Tests
3
3
While you may start your Spring Boot application very easily from your test (or test suite) itself, it may be desirable to handle that in the build itself.
4
4
To make sure that the lifecycle of your Spring Boot application is properly managed around your integration tests, you can use the `start` and `stop` goals, as shown in the following example:
Such setup can now use the https://maven.apache.org/surefire/maven-failsafe-plugin[failsafe-plugin] to run your integration tests as you would expect.
12
12
13
13
NOTE: By default, the application is started in a separate process and JMX is used to communicate with the application.
14
-
If you need to configure the JMX port, see <<integration-tests-example-jmx-port,the dedicated example>>.
14
+
If you need to configure the JMX port, see <<integration-tests.examples.jmx-port,the dedicated example>>.
15
15
16
-
You could also configure a more advanced setup to skip the integration tests when a specific property has been set, see <<integration-tests-example-skip,the dedicated example>>.
16
+
You could also configure a more advanced setup to skip the integration tests when a specific property has been set, see <<integration-tests.examples.skip,the dedicated example>>.
17
17
18
18
19
19
20
-
[[integration-tests-no-starter-parent]]
21
-
=== Using Failsafe Without Spring Boot's Parent POM
20
+
[[integration-tests.no-starter-parent]]
21
+
== Using Failsafe Without Spring Boot's Parent POM
22
22
Spring Boot's Parent POM, `spring-boot-starter-parent`, configures Failsafe's `<classesDirectory>` to be `${project.build.outputDirectory}`.
23
23
Without this configuration, which causes Failsafe to use the compiled classes rather than the repackaged jar, Failsafe cannot load your application's classes.
24
24
If you are not using the parent POM, you should configure Failsafe in the same way, as shown in the following example:
One nice feature of the Spring Boot test integration is that it can allocate a free port for the web application.
45
45
When the `start` goal of the plugin is used, the Spring Boot application is started separately, making it difficult to pass the actual port to the integration test itself.
46
46
@@ -55,8 +55,8 @@ You can now retrieve the `test.server.port` system property in any of your integ
55
55
56
56
57
57
58
-
[[integration-tests-example-jmx-port]]
59
-
==== Customize JMX port
58
+
[[integration-tests.examples.jmx-port]]
59
+
=== Customize JMX port
60
60
The `jmxPort` property allows to customize the port the plugin uses to communicate with the Spring Boot application.
61
61
62
62
This example shows how you can customize the port in case `9001` is already used:
@@ -70,8 +70,8 @@ TIP: If you need to configure the JMX port, make sure to do so in the global con
70
70
71
71
72
72
73
-
[[integration-tests-example-skip]]
74
-
==== Skip Integration Tests
73
+
[[integration-tests.examples.skip]]
74
+
=== Skip Integration Tests
75
75
The `skip` property allows to skip the execution of the Spring Boot maven plugin altogether.
76
76
77
77
This example shows how you can skip integration tests with a command-line property and still make sure that the `repackage` goal runs:
The Spring Boot Maven Plugin provides Spring Boot support in https://maven.org[Apache Maven].
4
+
It allows you to package executable jar or war archives, run Spring Boot applications, generate build information and start your Spring Boot application prior to running integration tests.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging-oci-image.adoc
+28-28Lines changed: 28 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
[[build-image]]
2
-
==Packaging OCI Images
2
+
= Packaging OCI Images
3
3
The plugin can create an https://github.com/opencontainers/image-spec[OCI image] from a jar or war file using https://buildpacks.io/[Cloud Native Buildpacks] (CNB).
4
4
Images can be built using the `build-image` goal.
5
5
@@ -14,13 +14,13 @@ It is possible to automate the creation of an image whenever the `package` phase
TIP: While the buildpack runs from an <<repackage,executable archive>>, it is not necessary to execute the `repackage` goal first as the executable archive is created automatically if necessary.
17
+
TIP: While the buildpack runs from an <<packaging,executable archive>>, it is not necessary to execute the `repackage` goal first as the executable archive is created automatically if necessary.
18
18
When the `build-image` repackages the application, it applies the same settings as the `repackage` goal would, i.e. dependencies can be excluded using one of the exclude options, and Devtools is automatically excluded by default (you can control that using the `excludeDevtools` property).
19
19
20
20
21
21
22
-
[[build-image-docker-daemon]]
23
-
=== Docker Daemon
22
+
[[build-image.docker-daemon]]
23
+
== Docker Daemon
24
24
The `build-image` goal requires access to a Docker daemon.
25
25
By default, it will communicate with a Docker daemon over a local connection.
26
26
This works with https://docs.docker.com/install/[Docker Engine] on all supported platforms without configuration.
@@ -59,12 +59,12 @@ The following table summarizes the available parameters:
59
59
| Path to certificate and key files for HTTPS (required if `tlsVerify` is `true`, ignored otherwise)
60
60
|===
61
61
62
-
For more details, see also <<build-image-example-docker,examples>>.
62
+
For more details, see also <<build-image.examples.docker,examples>>.
63
63
64
64
65
65
66
-
[[build-image-docker-registry]]
67
-
=== Docker Registry
66
+
[[build-image.docker-registry]]
67
+
== Docker Registry
68
68
If the Docker images specified by the `builder` or `runImage` parameters are stored in a private Docker image registry that requires authentication, the authentication credentials can be provided using `docker.builderRegistry` parameters.
69
69
70
70
If the generated Docker image is to be published to a Docker image registry, the authentication credentials can be provided using `docker.publishRegistry` parameters.
@@ -93,12 +93,12 @@ The following table summarizes the available parameters for `docker.builderRegis
93
93
| Identity token for the Docker image registry user. Required for token authentication.
94
94
|===
95
95
96
-
For more details, see also <<build-image-example-docker,examples>>.
96
+
For more details, see also <<build-image.examples.docker,examples>>.
97
97
98
98
99
99
100
-
[[build-image-customization]]
101
-
=== Image Customizations
100
+
[[build-image.customization]]
101
+
== Image Customizations
102
102
The plugin invokes a {buildpacks-reference}/concepts/components/builder/[builder] to orchestrate the generation of an image.
103
103
The builder includes multiple {buildpacks-reference}/concepts/components/buildpack[buildpacks] that can inspect the application to influence the generated image.
104
104
By default, the plugin chooses a builder image.
@@ -182,21 +182,21 @@ Where `<options>` can contain:
182
182
183
183
NOTE: The plugin detects the target Java compatibility of the project using the compiler's plugin configuration or the `maven.compiler.target` property.
184
184
When using the default Paketo builder and buildpacks, the plugin instructs the buildpacks to install the same Java version.
185
-
You can override this behaviour as shown in the <<build-image-example-builder-configuration,builder configuration>> examples.
185
+
You can override this behaviour as shown in the <<build-image.examples.builder-configuration,builder configuration>> examples.
186
186
187
-
For more details, see also <<build-image-examples,examples>>.
187
+
For more details, see also <<build-image.examples,examples>>.
188
188
189
189
include::goals/build-image.adoc[leveloffset=+1]
190
190
191
191
192
192
193
-
[[build-image-examples]]
194
-
=== Examples
193
+
[[build-image.examples]]
194
+
== Examples
195
195
196
196
197
197
198
-
[[build-image-example-custom-image-builder]]
199
-
==== Custom Image Builder
198
+
[[build-image.examples.custom-image-builder]]
199
+
=== Custom Image Builder
200
200
If you need to customize the builder used to create the image or the run image used to launch the built image, configure the plugin as shown in the following example:
@@ -215,8 +215,8 @@ The builder and run image can be specified on the command line as well, as shown
215
215
216
216
217
217
218
-
[[build-image-example-builder-configuration]]
219
-
==== Builder Configuration
218
+
[[build-image.examples.builder-configuration]]
219
+
=== Builder Configuration
220
220
If the builder exposes configuration options using environment variables, those can be set using the `env` attributes.
221
221
222
222
The following is an example of {paketo-java-reference}/#configuring-the-jvm-version[configuring the JVM version] used by the Paketo Java buildpacks at build time:
Paketo Java buildpacks {paketo-java-reference}/#runtime-jvm-configuration[configure the JVM runtime environment] by setting the `JAVA_TOOL_OPTIONS` environment variable.
242
242
The buildpack-provided `JAVA_TOOL_OPTIONS` value can be modified to customize JVM runtime behavior when the application image is launched in a container.
By default, the image name is inferred from the `artifactId` and the `version` of the project, something like `docker.io/library/${project.artifactId}:${project.version}`.
256
256
You can take control over the name, as shown in the following example:
257
257
@@ -272,8 +272,8 @@ The image name can be specified on the command line as well, as shown in this ex
272
272
273
273
274
274
275
-
[[build-image-example-buildpacks]]
276
-
==== Buildpacks
275
+
[[build-image.examples.buildpacks]]
276
+
=== Buildpacks
277
277
By default, the builder will use buildpacks included in the builder image and apply them in a pre-defined order.
278
278
An alternative set of buildpacks can be provided to apply buildpacks that are not included in the builder, or to change the order of included buildpacks.
279
279
When one or more buildpacks are provided, only the specified buildpacks will be applied.
@@ -315,8 +315,8 @@ An OCI image containing a https://buildpacks.io/docs/buildpack-author-guide/pack
315
315
316
316
317
317
318
-
[[build-image-example-publish]]
319
-
==== Image Publishing
318
+
[[build-image.examples.publish]]
319
+
=== Image Publishing
320
320
The generated image can be published to a Docker registry by enabling a `publish` option and configuring authentication for the registry using `docker.publishRegistry` parameters.
@@ -333,8 +333,8 @@ The `publish` option can be specified on the command line as well, as shown in t
333
333
334
334
335
335
336
-
[[build-image-example-docker]]
337
-
==== Docker Configuration
336
+
[[build-image.examples.docker]]
337
+
=== Docker Configuration
338
338
If you need the plugin to communicate with the Docker daemon using a remote connection instead of the default local connection, the connection details can be provided using `docker` parameters as shown in the following example:
0 commit comments