Support Building Against a Different JDK Version
Can use -PtestToolchain=17 to test the compatibility against JDK 17
This commit is contained in:
@@ -65,8 +65,16 @@ public abstract class AbstractSpringJavaPlugin implements Plugin<Project> {
|
||||
project.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
project.java.sourceCompatibility = toolchainVersion(project)
|
||||
additionalPlugins(project);
|
||||
}
|
||||
|
||||
protected abstract void additionalPlugins(Project project);
|
||||
|
||||
private Integer toolchainVersion(Project project) {
|
||||
if (project.hasProperty("testToolchain")) {
|
||||
return project.property("testToolchain").toString().toInteger();
|
||||
}
|
||||
return 17;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,6 @@ class SpringModulePlugin extends AbstractSpringJavaPlugin {
|
||||
if (!Utils.isRelease(project)) {
|
||||
deployArtifacts.dependsOn project.tasks.artifactoryPublish
|
||||
}
|
||||
project.java.sourceCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
* the License.
|
||||
*/
|
||||
|
||||
package io.spring.gradle.convention;
|
||||
package io.spring.gradle.convention
|
||||
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.Project
|
||||
|
||||
/**
|
||||
* @author Rob Winch
|
||||
|
||||
Reference in New Issue
Block a user