Use new gradle plugin ID as of Spring Boot 1.4.2

Closes gh-296
This commit is contained in:
Stephane Nicoll 2016-10-07 15:59:02 +02:00
parent 4637fe21da
commit 91c9ad384b
3 changed files with 17 additions and 1 deletions

View File

@ -50,6 +50,8 @@ class ProjectGenerator {
private static final VERSION_1_4_0_M3 = Version.parse('1.4.0.M3') private static final VERSION_1_4_0_M3 = Version.parse('1.4.0.M3')
private static final VERSION_1_4_2_M1 = Version.parse('1.4.2.M1')
@Autowired @Autowired
ApplicationEventPublisher eventPublisher ApplicationEventPublisher eventPublisher
@ -278,6 +280,10 @@ class ProjectGenerator {
model['bootOneThreeAvailable'] = VERSION_1_3_0_M1 model['bootOneThreeAvailable'] = VERSION_1_3_0_M1
.compareTo(Version.safeParse(request.bootVersion)) <= 0 .compareTo(Version.safeParse(request.bootVersion)) <= 0
// Gradle plugin has changed again as from 1.4.2
model['springBootPluginName'] = (VERSION_1_4_2_M1.compareTo(
Version.safeParse(request.bootVersion)) <= 0 ? 'org.springframework.boot' : 'spring-boot')
// New testing stuff // New testing stuff
model['newTestInfrastructure'] = isNewTestInfrastructureAvailable(request) model['newTestInfrastructure'] = isNewTestInfrastructureAvailable(request)

View File

@ -17,7 +17,7 @@ buildscript {
apply plugin: '${language}'<% if (packaging=='war') { %> apply plugin: '${language}'<% if (packaging=='war') { %>
apply plugin: 'eclipse-wtp'<% } else { %> apply plugin: 'eclipse-wtp'<% } else { %>
apply plugin: 'eclipse'<% } %> apply plugin: 'eclipse'<% } %>
apply plugin: 'spring-boot'<% if (!bootOneThreeAvailable) { %> apply plugin: '${springBootPluginName}'<% if (!bootOneThreeAvailable) { %>
apply plugin: 'io.spring.dependency-management'<% } %><% if (packaging=='war') { %> apply plugin: 'io.spring.dependency-management'<% } %><% if (packaging=='war') { %>
apply plugin: 'war' apply plugin: 'war'
<% } %> <% } %>

View File

@ -460,6 +460,16 @@ class ProjectGeneratorTests extends AbstractProjectGeneratorTests {
.doesNotContain("apply plugin: 'io.spring.dependency-management'") .doesNotContain("apply plugin: 'io.spring.dependency-management'")
} }
@Test
void gradleBuildAsFromSpringBoot142() {
def request = createProjectRequest('web')
request.bootVersion = '1.4.2.BUILD-SNAPSHOT'
generateGradleBuild(request)
.contains("springBootVersion = '1.4.2.BUILD-SNAPSHOT'")
.contains("apply plugin: 'org.springframework.boot'")
.doesNotContain("apply plugin: 'spring-boot'")
}
@Test @Test
void mavenBom() { void mavenBom() {
def foo = new Dependency(id: 'foo', groupId: 'org.acme', artifactId: 'foo', bom: 'foo-bom') def foo = new Dependency(id: 'foo', groupId: 'org.acme', artifactId: 'foo', bom: 'foo-bom')