Merge pull request #14680 from JB Nizet
* gh-14680: Polish "Refactor Gradle plugin tests to use runner's plugin classpath" Refactor Gradle plugin tests to use runner's plugin classpath
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
<gradle.executable>./gradlew</gradle.executable>
|
||||
<gradle.task>build</gradle.task>
|
||||
<skip.gradle.build>false</skip.gradle.build>
|
||||
<kotlin.version>1.2.10</kotlin.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
// tag::apply[]
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
// tag::additional[]
|
||||
springBoot {
|
||||
buildInfo {
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
// tag::build-info[]
|
||||
springBoot {
|
||||
buildInfo()
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
// tag::custom-values[]
|
||||
springBoot {
|
||||
buildInfo {
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
|
||||
dependencyManagement {
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
|
||||
// tag::dependencies[]
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'application'
|
||||
|
||||
// tag::main-class[]
|
||||
mainClassName = 'com.example.ExampleApplication'
|
||||
// end::main-class[]
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
// tag::enable-jar[]
|
||||
jar {
|
||||
enabled = true
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
bootJar {
|
||||
mainClassName 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
bootJar {
|
||||
mainClassName 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
bootJar {
|
||||
mainClassName 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
// tag::main-class[]
|
||||
bootJar {
|
||||
mainClassName = 'com.example.ExampleApplication'
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
// tag::main-class[]
|
||||
bootJar {
|
||||
manifest {
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'war'
|
||||
|
||||
bootWar {
|
||||
mainClassName 'com.example.ExampleApplication'
|
||||
classpath file('spring-boot-devtools-1.2.3.RELEASE.jar')
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'war'
|
||||
|
||||
bootWar {
|
||||
mainClassName 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
// tag::main-class[]
|
||||
springBoot {
|
||||
mainClassName = 'com.example.ExampleApplication'
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
|
||||
// tag::dependencies[]
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'maven-publish'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
// tag::publishing[]
|
||||
publishing {
|
||||
publications {
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'maven'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven'
|
||||
|
||||
// tag::upload[]
|
||||
uploadBootArchives {
|
||||
repositories {
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'application'
|
||||
|
||||
// tag::main-class[]
|
||||
mainClassName = 'com.example.ExampleApplication'
|
||||
// end::main-class[]
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
// tag::main[]
|
||||
bootRun {
|
||||
main = 'com.example.ExampleApplication'
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
// tag::source-resources[]
|
||||
bootRun {
|
||||
sourceResources sourceSets.main
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'application'
|
||||
|
||||
// tag::main-class[]
|
||||
springBoot {
|
||||
mainClassName = 'com.example.ExampleApplication'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* Copyright 2012-2018 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.
|
||||
@@ -34,6 +34,11 @@ import io.spring.gradle.dependencymanagement.DependencyManagementPlugin;
|
||||
import org.apache.commons.compress.archivers.ArchiveEntry;
|
||||
import org.gradle.testkit.runner.BuildResult;
|
||||
import org.gradle.testkit.runner.GradleRunner;
|
||||
import org.jetbrains.kotlin.cli.common.PropertiesKt;
|
||||
import org.jetbrains.kotlin.compilerRunner.KotlinCompilerRunner;
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin;
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPlugin;
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
import org.junit.rules.TestRule;
|
||||
import org.junit.runner.Description;
|
||||
@@ -114,17 +119,18 @@ public class GradleBuild implements TestRule {
|
||||
GradleBuild.this.script = null;
|
||||
}
|
||||
|
||||
private String pluginClasspath() {
|
||||
return absolutePath("bin") + "," + absolutePath("build/classes/java/main") + ","
|
||||
+ absolutePath("build/resources/main") + ","
|
||||
+ pathOfJarContaining(LaunchScript.class) + ","
|
||||
+ pathOfJarContaining(ClassVisitor.class) + ","
|
||||
+ pathOfJarContaining(DependencyManagementPlugin.class) + ","
|
||||
+ pathOfJarContaining(ArchiveEntry.class);
|
||||
}
|
||||
|
||||
private String absolutePath(String path) {
|
||||
return new File(path).getAbsolutePath();
|
||||
private List<File> pluginClasspath() {
|
||||
return Arrays.asList(new File("bin"), new File("build/classes/java/main"),
|
||||
new File("build/resources/main"),
|
||||
new File(pathOfJarContaining(LaunchScript.class)),
|
||||
new File(pathOfJarContaining(ClassVisitor.class)),
|
||||
new File(pathOfJarContaining(DependencyManagementPlugin.class)),
|
||||
new File(pathOfJarContaining(KotlinPluginWrapper.class)),
|
||||
new File(pathOfJarContaining(PropertiesKt.class)),
|
||||
new File(pathOfJarContaining(KotlinCompilerRunner.class)),
|
||||
new File(pathOfJarContaining(KotlinPlugin.class)),
|
||||
new File(pathOfJarContaining(KotlinGradleSubplugin.class)),
|
||||
new File(pathOfJarContaining(ArchiveEntry.class)));
|
||||
}
|
||||
|
||||
private String pathOfJarContaining(Class<?> type) {
|
||||
@@ -160,12 +166,12 @@ public class GradleBuild implements TestRule {
|
||||
FileCopyUtils.copy(scriptContent,
|
||||
new FileWriter(new File(this.projectDir, "build.gradle")));
|
||||
GradleRunner gradleRunner = GradleRunner.create().withProjectDir(this.projectDir)
|
||||
.withDebug(true);
|
||||
.withDebug(true).withPluginClasspath(pluginClasspath());
|
||||
|
||||
if (this.gradleVersion != null) {
|
||||
gradleRunner.withGradleVersion(this.gradleVersion);
|
||||
}
|
||||
List<String> allArguments = new ArrayList<>();
|
||||
allArguments.add("-PpluginClasspath=" + pluginClasspath());
|
||||
allArguments.add("-PbootVersion=" + getBootVersion());
|
||||
allArguments.add("--stacktrace");
|
||||
allArguments.addAll(Arrays.asList(arguments));
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
group = 'com.example'
|
||||
version = '1.0'
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
group = 'com.example'
|
||||
version = '1.0'
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'war'
|
||||
|
||||
group = 'com.example'
|
||||
version = '1.0'
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
springBoot {
|
||||
buildInfo()
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
group = 'com.example'
|
||||
version = '1.0'
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'war'
|
||||
|
||||
group = 'com.example'
|
||||
version = '1.0'
|
||||
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'java'
|
||||
|
||||
applicationName = 'custom'
|
||||
|
||||
bootJar {
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'java'
|
||||
|
||||
bootJar {
|
||||
mainClassName = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'java'
|
||||
|
||||
bootJar {
|
||||
mainClassName = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'war'
|
||||
|
||||
bootWar {
|
||||
mainClassName = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'java'
|
||||
|
||||
bootJar {
|
||||
mainClassName = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'war'
|
||||
|
||||
bootWar {
|
||||
mainClassName = 'com.example.ExampleApplication'
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
if (project.hasProperty('applyApplicationPlugin')) {
|
||||
apply plugin: 'application'
|
||||
applicationDefaultJvmArgs = ['-Dcom.example.a=alpha', '-Dcom.example.b=bravo']
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
if (project.hasProperty('applyDependencyManagementPlugin')) {
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
dependencyManagement {
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
repositories {
|
||||
flatDir { dirs 'libs' }
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
compileJava {
|
||||
doLast {
|
||||
println "$name compiler args: ${options.compilerArgs}"
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
bootJar {
|
||||
mainClassName = 'com.example.Application'
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
bootJar {
|
||||
mainClassName = 'com.example.Application'
|
||||
classifier = 'boot'
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.compilerArgs = ['-Xlint:all']
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.compilerArgs << '-Xlint:all'
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
task('javaCompileTasksCompilerArgs') {
|
||||
doFirst {
|
||||
tasks.withType(JavaCompile) {
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
if (project.hasProperty('applyJavaPlugin')) {
|
||||
apply plugin: 'java'
|
||||
}
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.2.10'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'org.jetbrains.kotlin.jvm'
|
||||
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
|
||||
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.2.10'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'org.jetbrains.kotlin.jvm'
|
||||
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
|
||||
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.2.10'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
apply plugin: 'org.jetbrains.kotlin.jvm'
|
||||
|
||||
dependencyManagement {
|
||||
resolutionStrategy {
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
task kotlinVersion {
|
||||
doLast {
|
||||
def kotlinVersion = project.hasProperty('kotlin.version') ? project.getProperty('kotlin.version') : 'none'
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'maven'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven'
|
||||
|
||||
task('conf2ScopeMappings') {
|
||||
doFirst {
|
||||
tasks.getByName('uploadBootArchives').repositories.withType(MavenResolver) {
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '{version}' apply false
|
||||
id 'java'
|
||||
}
|
||||
|
||||
apply plugin: 'io.spring.dependency-management'
|
||||
apply plugin: 'java'
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'java'
|
||||
|
||||
repositories {
|
||||
flatDir { dirs 'libs' }
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'war'
|
||||
|
||||
bootWar {
|
||||
mainClassName = 'com.example.Application'
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'war'
|
||||
|
||||
bootWar {
|
||||
mainClassName = 'com.example.Application'
|
||||
classifier = 'boot'
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
if (project.hasProperty('applyWarPlugin')) {
|
||||
apply plugin: 'war'
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '{version}' apply false
|
||||
}
|
||||
|
||||
def property(String name, Object defaultValue) {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '{version}' apply false
|
||||
}
|
||||
|
||||
def property(String name, Object defaultValue) {
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'application'
|
||||
|
||||
mainClassName = 'com.example.CustomMain'
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
bootJar {
|
||||
mainClassName = 'com.example.CustomMain'
|
||||
duplicatesStrategy = "exclude"
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
bootJar {
|
||||
mainClassName = 'com.example.Application'
|
||||
preserveFileTimestamps = false
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'application'
|
||||
|
||||
springBoot {
|
||||
mainClassName = 'com.example.CustomMain'
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
bootJar {
|
||||
mainClassName = 'com.example.Application'
|
||||
if (project.hasProperty('includeLaunchScript') ? includeLaunchScript : false) {
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'war'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'application'
|
||||
|
||||
mainClassName = 'com.example.CustomMain'
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'war'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
bootWar {
|
||||
mainClassName = 'com.example.Application'
|
||||
preserveFileTimestamps = false
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'war'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'application'
|
||||
|
||||
springBoot {
|
||||
mainClassName = 'com.example.CustomMain'
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'war'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
bootWar {
|
||||
mainClassName = 'com.example.Application'
|
||||
if (project.hasProperty('includeLaunchScript') ? includeLaunchScript : false) {
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'maven'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'maven'
|
||||
|
||||
bootJar {
|
||||
mainClassName = 'com.example.Application'
|
||||
}
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'maven'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'war'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'maven'
|
||||
|
||||
bootWar {
|
||||
mainClassName = 'com.example.Application'
|
||||
}
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'maven-publish'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
bootJar {
|
||||
mainClassName = 'com.example.Application'
|
||||
}
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'war'
|
||||
id 'maven-publish'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'war'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
bootWar {
|
||||
mainClassName = 'com.example.Application'
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
applicationDefaultJvmArgs = ['-Dcom.foo=bar', '-Dcom.bar=baz']
|
||||
|
||||
task echoJvmArguments {
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
task echoMainClassName {
|
||||
dependsOn compileJava
|
||||
doLast {
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
mainClassName = 'com.example.CustomMainClass'
|
||||
|
||||
task echoMainClassName {
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
bootRun {
|
||||
sourceResources sourceSets.main
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath files(pluginClasspath.split(','))
|
||||
}
|
||||
plugins {
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'org.springframework.boot'
|
||||
|
||||
springBoot {
|
||||
mainClassName = 'com.example.CustomMainClass'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user