Drop custom software component in favor of just publishing an artifact
Previously, Spring Boot's Gradle plugin provided custom software components (bootJava and bootWeb) for publishing the artifacts created by the standard bootJar and bootWar tasks respectively. Providing a custom software component requires the usage of some of Gradle's internal APIs and this has now proven to be more trouble than it is worth. This commit removes the custom software component and documents how to publish the artifact created by a BootJar or BootWar task directly instead. Closes gh-9153
This commit is contained in:
@@ -66,19 +66,6 @@ public class JavaPluginActionIntegrationTests {
|
||||
.getOutput()).contains("bootRun exists = true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void noBootJavaSoftwareComponentWithoutJavaPluginApplied() {
|
||||
assertThat(this.gradleBuild.build("componentExists", "-PcomponentName=bootJava")
|
||||
.getOutput()).contains("bootJava exists = false");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void applyingJavaPluginCreatesBootJavaSoftwareComponent() {
|
||||
assertThat(this.gradleBuild
|
||||
.build("componentExists", "-PcomponentName=bootJava", "-PapplyJavaPlugin")
|
||||
.getOutput()).contains("bootJava exists = true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void javaCompileTasksUseUtf8Encoding() {
|
||||
assertThat(this.gradleBuild.build("javaCompileEncoding", "-PapplyJavaPlugin")
|
||||
|
||||
@@ -53,19 +53,6 @@ public class WarPluginActionIntegrationTests {
|
||||
.getOutput()).contains("bootWar exists = true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void noBootWebSoftwareComponentWithoutJavaPluginApplied() {
|
||||
assertThat(this.gradleBuild.build("componentExists", "-PcomponentName=bootWeb")
|
||||
.getOutput()).contains("bootWeb exists = false");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void applyingJavaPluginCreatesBootWebSoftwareComponent() {
|
||||
assertThat(this.gradleBuild
|
||||
.build("componentExists", "-PcomponentName=bootWeb", "-PapplyWarPlugin")
|
||||
.getOutput()).contains("bootWeb exists = true");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void assembleRunsBootWarAndWarIsSkipped() {
|
||||
BuildResult result = this.gradleBuild.build("assemble");
|
||||
|
||||
@@ -16,12 +16,6 @@ task('taskExists') {
|
||||
}
|
||||
}
|
||||
|
||||
task('componentExists') {
|
||||
doFirst {
|
||||
println "$componentName exists = ${components.findByName(componentName) != null}"
|
||||
}
|
||||
}
|
||||
|
||||
task('javaCompileEncoding') {
|
||||
doFirst {
|
||||
tasks.withType(JavaCompile) {
|
||||
|
||||
@@ -15,9 +15,3 @@ task('taskExists') {
|
||||
println "$taskName exists = ${tasks.findByName(taskName) != null}"
|
||||
}
|
||||
}
|
||||
|
||||
task('componentExists') {
|
||||
doFirst {
|
||||
println "$componentName exists = ${components.findByName(componentName) != null}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ publishing {
|
||||
}
|
||||
}
|
||||
publications {
|
||||
mavenBootJava(MavenPublication) {
|
||||
from components.bootJava
|
||||
bootJava(MavenPublication) {
|
||||
artifact bootJar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ publishing {
|
||||
}
|
||||
}
|
||||
publications {
|
||||
mavenBootWeb(MavenPublication) {
|
||||
from components.bootWeb
|
||||
bootWeb(MavenPublication) {
|
||||
artifact bootWar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user