mirror of
https://gitee.com/dcren/initializr.git
synced 2026-01-23 05:12:01 +08:00
Upgrade to Kotlin 1.0.6 with kotlin-spring plugin
The kotlin-spring plugin automatically opens classes annotated or meta-annotated with annotations like @Component or @Transactional. Closes gh-333
This commit is contained in:
committed by
Stephane Nicoll
parent
51afc6585c
commit
e6cf9cf658
@@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration<% } %>
|
|||||||
@Configuration
|
@Configuration
|
||||||
@ComponentScan
|
@ComponentScan
|
||||||
@EnableAutoConfiguration <% } %>
|
@EnableAutoConfiguration <% } %>
|
||||||
open class ${applicationName}
|
class ${applicationName}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
SpringApplication.run(${applicationName}::class.java, *args)
|
SpringApplication.run(${applicationName}::class.java, *args)
|
||||||
|
|||||||
@@ -10,11 +10,13 @@ buildscript {
|
|||||||
dependencies {
|
dependencies {
|
||||||
classpath("org.springframework.boot:spring-boot-gradle-plugin:\${springBootVersion}")<% if (!bootOneThreeAvailable) { %>
|
classpath("org.springframework.boot:spring-boot-gradle-plugin:\${springBootVersion}")<% if (!bootOneThreeAvailable) { %>
|
||||||
classpath('io.spring.gradle:dependency-management-plugin:${dependencyManagementPluginVersion}')<% } %><% if (language=='kotlin') { %>
|
classpath('io.spring.gradle:dependency-management-plugin:${dependencyManagementPluginVersion}')<% } %><% if (language=='kotlin') { %>
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:\${kotlinVersion}")<% } %>
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:\${kotlinVersion}")
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-allopen:\${kotlinVersion}")<% } %>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: '${language}'<% if (packaging=='war') { %>
|
apply plugin: '${language}'<% if (language=='kotlin') { %>
|
||||||
|
apply plugin: 'kotlin-spring'<% } %><% if (packaging=='war') { %>
|
||||||
apply plugin: 'eclipse-wtp'<% } else { %>
|
apply plugin: 'eclipse-wtp'<% } else { %>
|
||||||
apply plugin: 'eclipse'<% } %>
|
apply plugin: 'eclipse'<% } %>
|
||||||
apply plugin: '${springBootPluginName}'<% if (!bootOneThreeAvailable) { %>
|
apply plugin: '${springBootPluginName}'<% if (!bootOneThreeAvailable) { %>
|
||||||
|
|||||||
@@ -118,6 +118,11 @@
|
|||||||
<artifactId>kotlin-maven-plugin</artifactId>
|
<artifactId>kotlin-maven-plugin</artifactId>
|
||||||
<groupId>org.jetbrains.kotlin</groupId>
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
<version>\${kotlin.version}</version>
|
<version>\${kotlin.version}</version>
|
||||||
|
<configuration>
|
||||||
|
<compilerPlugins>
|
||||||
|
<plugin>spring</plugin>
|
||||||
|
</compilerPlugins>
|
||||||
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>compile</id>
|
<id>compile</id>
|
||||||
@@ -134,6 +139,13 @@
|
|||||||
</goals>
|
</goals>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-maven-allopen</artifactId>
|
||||||
|
<version>\${kotlin.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
</plugin><% } %>
|
</plugin><% } %>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import org.springframework.boot.SpringApplication
|
|||||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
open class DemoApplication
|
class DemoApplication
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
SpringApplication.run(DemoApplication::class.java, *args)
|
SpringApplication.run(DemoApplication::class.java, *args)
|
||||||
|
|||||||
@@ -10,10 +10,12 @@ buildscript {
|
|||||||
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
|
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
|
||||||
classpath('io.spring.gradle:dependency-management-plugin:0.5.1.RELEASE')
|
classpath('io.spring.gradle:dependency-management-plugin:0.5.1.RELEASE')
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'kotlin'
|
||||||
|
apply plugin: 'kotlin-spring'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
apply plugin: 'spring-boot'
|
apply plugin: 'spring-boot'
|
||||||
apply plugin: 'io.spring.dependency-management'
|
apply plugin: 'io.spring.dependency-management'
|
||||||
|
|||||||
@@ -55,6 +55,11 @@
|
|||||||
<artifactId>kotlin-maven-plugin</artifactId>
|
<artifactId>kotlin-maven-plugin</artifactId>
|
||||||
<groupId>org.jetbrains.kotlin</groupId>
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
<version>${kotlin.version}</version>
|
<version>${kotlin.version}</version>
|
||||||
|
<configuration>
|
||||||
|
<compilerPlugins>
|
||||||
|
<plugin>spring</plugin>
|
||||||
|
</compilerPlugins>
|
||||||
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>compile</id>
|
<id>compile</id>
|
||||||
@@ -71,6 +76,13 @@
|
|||||||
</goals>
|
</goals>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-maven-allopen</artifactId>
|
||||||
|
<version>${kotlin.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|||||||
@@ -10,10 +10,12 @@ buildscript {
|
|||||||
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
|
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
|
||||||
classpath('io.spring.gradle:dependency-management-plugin:0.5.1.RELEASE')
|
classpath('io.spring.gradle:dependency-management-plugin:0.5.1.RELEASE')
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'kotlin'
|
||||||
|
apply plugin: 'kotlin-spring'
|
||||||
apply plugin: 'eclipse-wtp'
|
apply plugin: 'eclipse-wtp'
|
||||||
apply plugin: 'spring-boot'
|
apply plugin: 'spring-boot'
|
||||||
apply plugin: 'io.spring.dependency-management'
|
apply plugin: 'io.spring.dependency-management'
|
||||||
|
|||||||
@@ -60,6 +60,11 @@
|
|||||||
<artifactId>kotlin-maven-plugin</artifactId>
|
<artifactId>kotlin-maven-plugin</artifactId>
|
||||||
<groupId>org.jetbrains.kotlin</groupId>
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
<version>${kotlin.version}</version>
|
<version>${kotlin.version}</version>
|
||||||
|
<configuration>
|
||||||
|
<compilerPlugins>
|
||||||
|
<plugin>spring</plugin>
|
||||||
|
</compilerPlugins>
|
||||||
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>compile</id>
|
<id>compile</id>
|
||||||
@@ -76,6 +81,13 @@
|
|||||||
</goals>
|
</goals>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-maven-allopen</artifactId>
|
||||||
|
<version>${kotlin.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ initializr:
|
|||||||
gradle:
|
gradle:
|
||||||
dependency-management-plugin-version: 0.6.0.RELEASE
|
dependency-management-plugin-version: 0.6.0.RELEASE
|
||||||
kotlin:
|
kotlin:
|
||||||
version: 1.0.5-2
|
version: 1.0.6
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: Core
|
- name: Core
|
||||||
content:
|
content:
|
||||||
|
|||||||
Reference in New Issue
Block a user