Polish "Add toolchains support for Spring Boot Maven Plugin"

See gh-18732
pull/19476/head
Stephane Nicoll 5 years ago
parent eede16ff0a
commit e7f45d8a34

@ -235,11 +235,11 @@
<maven-shade-plugin.version>3.2.1</maven-shade-plugin.version>
<maven-source-plugin.version>3.2.0</maven-source-plugin.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<maven-toolchains-plugin.version>3.0.0</maven-toolchains-plugin.version>
<maven-war-plugin.version>3.2.3</maven-war-plugin.version>
<versions-maven-plugin.version>2.7</versions-maven-plugin.version>
<xml-maven-plugin.version>1.0.2</xml-maven-plugin.version>
<flatten-maven-plugin.version>1.1.0</flatten-maven-plugin.version>
<maven-toolchains-plugin.version>3.0.0</maven-toolchains-plugin.version>
</properties>
<dependencyManagement>
<dependencies>
@ -3335,13 +3335,13 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<artifactId>maven-toolchains-plugin</artifactId>
<version>${maven-toolchains-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>${maven-toolchains-plugin.version}</version>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>

@ -25,7 +25,10 @@
</executions>
<configuration>
<toolchains>
<jdk/>
<jdk>
<version>42</version>
<vendor>test</vendor>
</jdk>
</toolchains>
</configuration>
</plugin>

@ -1,6 +1,10 @@
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>42</version>
<vendor>test</vendor>
</provides>
<configuration>
<jdkHome>jdkHome</jdkHome>
</configuration>

@ -1,3 +1,2 @@
def file = new File(basedir, "build.log")
return file.text.contains("The Maven Toolchains is awesome!")

@ -69,6 +69,20 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
@Parameter(defaultValue = "${project}", readonly = true, required = true)
private MavenProject project;
/**
* The current Maven session. This is used for toolchain manager API calls.
* @since 2.3.0
*/
@Parameter(defaultValue = "${session}", readonly = true)
private MavenSession session;
/**
* The toolchain manager to use to locate a custom JDK.
* @since 2.3.0
*/
@Component
private ToolchainManager toolchainManager;
/**
* Add maven resources to the classpath directly, this allows live in-place editing of
* resources. Duplicate resources are removed from {@code target/classes} to prevent
@ -209,20 +223,6 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
@Parameter(property = "spring-boot.run.skip", defaultValue = "false")
private boolean skip;
/**
* The Maven Session Object.
* @since 2.2.1
*/
@Parameter(defaultValue = "${session}", readonly = true)
private MavenSession session;
/**
* The toolchain manager to use.
* @since 2.2.1
*/
@Component
private ToolchainManager toolchainManager;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (this.skip) {

Loading…
Cancel
Save