Test Gradle plugin against Gradle 8.2-rc-1
Closes gh-35699
This commit is contained in:
parent
db03dc7743
commit
5623fe3b94
|
|
@ -22,12 +22,14 @@ import org.gradle.api.Action;
|
|||
import org.gradle.api.Project;
|
||||
import org.gradle.api.plugins.BasePlugin;
|
||||
import org.gradle.api.plugins.JavaPlugin;
|
||||
import org.gradle.api.plugins.JavaPluginExtension;
|
||||
import org.gradle.api.provider.Property;
|
||||
import org.gradle.api.tasks.SourceSet;
|
||||
import org.gradle.api.tasks.SourceSetContainer;
|
||||
import org.gradle.api.tasks.TaskContainer;
|
||||
import org.gradle.api.tasks.TaskProvider;
|
||||
import org.gradle.jvm.tasks.Jar;
|
||||
import org.gradle.util.GradleVersion;
|
||||
|
||||
import org.springframework.boot.gradle.tasks.buildinfo.BuildInfo;
|
||||
import org.springframework.boot.gradle.tasks.buildinfo.BuildInfoProperties;
|
||||
|
|
@ -117,7 +119,10 @@ public class SpringBootExtension {
|
|||
|
||||
@SuppressWarnings("deprecation")
|
||||
private SourceSetContainer sourceSets(Project project) {
|
||||
return project.getConvention().getPlugin(org.gradle.api.plugins.JavaPluginConvention.class).getSourceSets();
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
return project.getConvention().getPlugin(org.gradle.api.plugins.JavaPluginConvention.class).getSourceSets();
|
||||
}
|
||||
return project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets();
|
||||
}
|
||||
|
||||
private String determineArtifactBaseName() {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ import org.gradle.api.tasks.TaskProvider;
|
|||
import org.gradle.jvm.application.scripts.TemplateBasedScriptGenerator;
|
||||
import org.gradle.jvm.application.tasks.CreateStartScripts;
|
||||
|
||||
import org.springframework.boot.gradle.tasks.run.BootRun;
|
||||
|
||||
/**
|
||||
* Action that is executed in response to the {@link ApplicationPlugin} being applied.
|
||||
*
|
||||
|
|
@ -56,6 +58,10 @@ final class ApplicationPluginAction implements PluginApplicationAction {
|
|||
CopySpec binCopySpec = project.copySpec().into("bin").from(bootStartScripts);
|
||||
binCopySpec.setFileMode(0755);
|
||||
distribution.getContents().with(binCopySpec);
|
||||
project.getTasks()
|
||||
.named(SpringBootPlugin.BOOT_RUN_TASK_NAME, BootRun.class)
|
||||
.configure((bootRun) -> bootRun.getConventionMapping()
|
||||
.map("jvmArgs", javaApplication::getApplicationDefaultJvmArgs));
|
||||
}
|
||||
|
||||
private void configureCreateStartScripts(Project project, JavaApplication javaApplication,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
package org.springframework.boot.gradle.plugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Callable;
|
||||
|
|
@ -45,6 +44,7 @@ import org.gradle.api.tasks.bundling.Jar;
|
|||
import org.gradle.api.tasks.compile.JavaCompile;
|
||||
import org.gradle.jvm.toolchain.JavaToolchainService;
|
||||
import org.gradle.jvm.toolchain.JavaToolchainSpec;
|
||||
import org.gradle.util.GradleVersion;
|
||||
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage;
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar;
|
||||
|
|
@ -141,18 +141,12 @@ final class JavaPluginAction implements PluginApplicationAction {
|
|||
Callable<FileCollection> classpath = () -> sourceSets(project).findByName(SourceSet.MAIN_SOURCE_SET_NAME)
|
||||
.getRuntimeClasspath()
|
||||
.filter(new JarTypeFileSpec());
|
||||
TaskProvider<ResolveMainClassName> resolveProvider = ResolveMainClassName.registerForTask("bootRun", project,
|
||||
classpath);
|
||||
project.getTasks().register("bootRun", BootRun.class, (run) -> {
|
||||
TaskProvider<ResolveMainClassName> resolveProvider = ResolveMainClassName
|
||||
.registerForTask(SpringBootPlugin.BOOT_RUN_TASK_NAME, project, classpath);
|
||||
project.getTasks().register(SpringBootPlugin.BOOT_RUN_TASK_NAME, BootRun.class, (run) -> {
|
||||
run.setDescription("Runs this project as a Spring Boot application.");
|
||||
run.setGroup(ApplicationPlugin.APPLICATION_GROUP);
|
||||
run.classpath(classpath);
|
||||
run.getConventionMapping().map("jvmArgs", () -> {
|
||||
if (project.hasProperty("applicationDefaultJvmArgs")) {
|
||||
return project.property("applicationDefaultJvmArgs");
|
||||
}
|
||||
return Collections.emptyList();
|
||||
});
|
||||
run.getMainClass().convention(resolveProvider.flatMap(ResolveMainClassName::readMainClassName));
|
||||
configureToolchainConvention(project, run);
|
||||
});
|
||||
|
|
@ -166,7 +160,10 @@ final class JavaPluginAction implements PluginApplicationAction {
|
|||
|
||||
@SuppressWarnings("deprecation")
|
||||
private SourceSetContainer sourceSets(Project project) {
|
||||
return project.getConvention().getPlugin(org.gradle.api.plugins.JavaPluginConvention.class).getSourceSets();
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
return project.getConvention().getPlugin(org.gradle.api.plugins.JavaPluginConvention.class).getSourceSets();
|
||||
}
|
||||
return project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets();
|
||||
}
|
||||
|
||||
private void configureUtf8Encoding(Project evaluatedProject) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -70,6 +70,8 @@ public class SpringBootPlugin implements Plugin<Project> {
|
|||
*/
|
||||
public static final String BOOT_BUILD_IMAGE_TASK_NAME = "bootBuildImage";
|
||||
|
||||
static final String BOOT_RUN_TASK_NAME = "bootRun";
|
||||
|
||||
/**
|
||||
* The name of the {@code developmentOnly} configuration.
|
||||
* @since 2.3.0
|
||||
|
|
|
|||
|
|
@ -25,12 +25,14 @@ import org.gradle.api.artifacts.Configuration;
|
|||
import org.gradle.api.artifacts.ConfigurationContainer;
|
||||
import org.gradle.api.file.FileCollection;
|
||||
import org.gradle.api.plugins.BasePlugin;
|
||||
import org.gradle.api.plugins.JavaPluginExtension;
|
||||
import org.gradle.api.plugins.WarPlugin;
|
||||
import org.gradle.api.provider.Provider;
|
||||
import org.gradle.api.tasks.SourceSet;
|
||||
import org.gradle.api.tasks.SourceSetContainer;
|
||||
import org.gradle.api.tasks.TaskProvider;
|
||||
import org.gradle.api.tasks.bundling.War;
|
||||
import org.gradle.util.GradleVersion;
|
||||
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootBuildImage;
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootWar;
|
||||
|
|
@ -99,7 +101,10 @@ class WarPluginAction implements PluginApplicationAction {
|
|||
|
||||
@SuppressWarnings("deprecation")
|
||||
private SourceSetContainer sourceSets(Project project) {
|
||||
return project.getConvention().getPlugin(org.gradle.api.plugins.JavaPluginConvention.class).getSourceSets();
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
return project.getConvention().getPlugin(org.gradle.api.plugins.JavaPluginConvention.class).getSourceSets();
|
||||
}
|
||||
return project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets();
|
||||
}
|
||||
|
||||
private FileCollection providedRuntimeConfiguration(Project project) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ plugins {
|
|||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
applicationName = 'custom'
|
||||
application {
|
||||
applicationName = 'custom'
|
||||
}
|
||||
|
||||
bootJar {
|
||||
mainClass = 'com.example.ExampleApplication'
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ plugins {
|
|||
|
||||
if (project.hasProperty('applyApplicationPlugin')) {
|
||||
apply plugin: 'application'
|
||||
applicationDefaultJvmArgs = ['-Dcom.example.a=alpha', '-Dcom.example.b=bravo']
|
||||
application {
|
||||
applicationDefaultJvmArgs = ['-Dcom.example.a=alpha', '-Dcom.example.b=bravo']
|
||||
}
|
||||
}
|
||||
|
||||
task('taskExists') {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,17 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
imageName = "example/test-image-custom"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
imageName = "example/test-image-name"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootJar {
|
||||
launchScript()
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
|
|
@ -7,8 +9,16 @@ if (project.hasProperty('applyWarPlugin')) {
|
|||
apply plugin: 'war'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
|
|
@ -7,8 +9,16 @@ if (project.hasProperty('applyWarPlugin')) {
|
|||
apply plugin: 'war'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
import org.gradle.util.GradleVersion
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("7.1")) < 0) {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
else {
|
||||
java {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
bootBuildImage {
|
||||
builder = "projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1"
|
||||
|
|
|
|||
|
|
@ -4,4 +4,6 @@ plugins {
|
|||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
mainClassName = 'com.example.CustomMain'
|
||||
application {
|
||||
mainClass = 'com.example.CustomMain'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,4 +4,6 @@ plugins {
|
|||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
mainClassName = 'com.example.CustomMain'
|
||||
application {
|
||||
mainClass = 'com.example.CustomMain'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,4 +3,6 @@ plugins {
|
|||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
mainClassName = 'com.example.bootrun.main.CustomMainClass'
|
||||
application {
|
||||
mainClass = 'com.example.bootrun.main.CustomMainClass'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,15 +34,16 @@ public final class GradleVersions {
|
|||
|
||||
public static List<String> allCompatible() {
|
||||
if (isJava18()) {
|
||||
return Arrays.asList("7.3.3", GradleVersion.current().getVersion(), "8.0.2", "8.1.1");
|
||||
return Arrays.asList("7.3.3", GradleVersion.current().getVersion(), "8.0.2", "8.1.1", "8.2-rc-1");
|
||||
}
|
||||
if (isJava17()) {
|
||||
return Arrays.asList("7.2", GradleVersion.current().getVersion(), "8.0.2", "8.1.1");
|
||||
return Arrays.asList("7.2", GradleVersion.current().getVersion(), "8.0.2", "8.1.1", "8.2-rc-1");
|
||||
}
|
||||
if (isJava16()) {
|
||||
return Arrays.asList("7.0.2", GradleVersion.current().getVersion(), "8.0.2", "8.1.1");
|
||||
return Arrays.asList("7.0.2", GradleVersion.current().getVersion(), "8.0.2", "8.1.1", "8.2-rc-1");
|
||||
}
|
||||
return Arrays.asList("6.8.3", "6.9.4", "7.0.2", GradleVersion.current().getVersion(), "8.0.2", "8.1.1");
|
||||
return Arrays.asList("6.8.3", "6.9.4", "7.0.2", GradleVersion.current().getVersion(), "8.0.2", "8.1.1",
|
||||
"8.2-rc-1");
|
||||
}
|
||||
|
||||
public static String minimumCompatible() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue