Polish "Add toolchains support for Spring Boot Maven Plugin"
See gh-18732
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user