Commit 11c5fba3 authored by Stephane Nicoll's avatar Stephane Nicoll

Remove unnecessary execution-specific configuration in documentation

This documentation moves the specific `build-image` execution
configuration example of the Maven plugin documentation to the general
plugin configuration. This makes sure that it works in most cases and
an execution-specific configuration is not required here anyway.

Closes gh-19946
parent 43555c9f
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
The plugin can create https://github.com/opencontainers/image-spec[OCI images] using a https://buildpacks.io/[buildpack]. The plugin can create https://github.com/opencontainers/image-spec[OCI images] using a https://buildpacks.io/[buildpack].
Images can be built using the `build-image` goal and a local Docker installation. Images can be built using the `build-image` goal and a local Docker installation.
The easiest way to get started is to to invoke `mvn spring-boot:build-image` on a project.
It is possible to automate the creation of an image whenever the `package` phase is invoked, as shown in the following example: It is possible to automate the creation of an image whenever the `package` phase is invoked, as shown in the following example:
[source,xml,indent=0,subs="verbatim,attributes"] [source,xml,indent=0,subs="verbatim,attributes"]
...@@ -51,19 +52,11 @@ If you need to customize the builder used to create the image, configure yours a ...@@ -51,19 +52,11 @@ If you need to customize the builder used to create the image, configure yours a
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<version>{version}</version> <version>{version}</version>
<executions> <configuration>
<execution> <image>
<id>build-image</id> <builder>mine/java-cnb-builder</builder>
<goals> </image>
<goal>build-image</goal> </configuration>
</goals>
<configuration>
<image>
<builder>mine/java-cnb-builder</builder>
</image>
</configuration>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
...@@ -88,19 +81,11 @@ You can take control over the name, as shown in the following example: ...@@ -88,19 +81,11 @@ You can take control over the name, as shown in the following example:
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<version>{version}</version> <version>{version}</version>
<executions> <configuration>
<execution> <image>
<id>build-image</id> <name>example.com/library/${project.artifactId}</name>
<goals> </image>
<goal>build-image</goal> </configuration>
</goals>
<configuration>
<image>
<name>example.com/library/${project.artifactId}</name>
</image>
</configuration>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment