mirror of
https://gitee.com/dcren/initializr.git
synced 2025-07-15 23:13:30 +08:00
Use new gradle plugin ID as of Spring Boot 1.4.2
Closes gh-296
This commit is contained in:
parent
4637fe21da
commit
91c9ad384b
@ -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_2_M1 = Version.parse('1.4.2.M1')
|
||||
|
||||
@Autowired
|
||||
ApplicationEventPublisher eventPublisher
|
||||
|
||||
@ -278,6 +280,10 @@ class ProjectGenerator {
|
||||
model['bootOneThreeAvailable'] = VERSION_1_3_0_M1
|
||||
.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
|
||||
model['newTestInfrastructure'] = isNewTestInfrastructureAvailable(request)
|
||||
|
||||
|
@ -17,7 +17,7 @@ buildscript {
|
||||
apply plugin: '${language}'<% if (packaging=='war') { %>
|
||||
apply plugin: 'eclipse-wtp'<% } else { %>
|
||||
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: 'war'
|
||||
<% } %>
|
||||
|
@ -460,6 +460,16 @@ class ProjectGeneratorTests extends AbstractProjectGeneratorTests {
|
||||
.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
|
||||
void mavenBom() {
|
||||
def foo = new Dependency(id: 'foo', groupId: 'org.acme', artifactId: 'foo', bom: 'foo-bom')
|
||||
|
Loading…
Reference in New Issue
Block a user