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:
Sebastien Deleuze 2016-12-28 11:29:26 +01:00 committed by Stephane Nicoll
parent 51afc6585c
commit e6cf9cf658
9 changed files with 47 additions and 5 deletions

View File

@ -10,7 +10,7 @@ import org.springframework.context.annotation.Configuration<% } %>
@Configuration
@ComponentScan
@EnableAutoConfiguration <% } %>
open class ${applicationName}
class ${applicationName}
fun main(args: Array<String>) {
SpringApplication.run(${applicationName}::class.java, *args)

View File

@ -10,11 +10,13 @@ buildscript {
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:\${springBootVersion}")<% if (!bootOneThreeAvailable) { %>
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'<% } %>
apply plugin: '${springBootPluginName}'<% if (!bootOneThreeAvailable) { %>

View File

@ -118,6 +118,11 @@
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>\${kotlin.version}</version>
<configuration>
<compilerPlugins>
<plugin>spring</plugin>
</compilerPlugins>
</configuration>
<executions>
<execution>
<id>compile</id>
@ -134,6 +139,13 @@
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-allopen</artifactId>
<version>\${kotlin.version}</version>
</dependency>
</dependencies>
</plugin><% } %>
</plugins>
</build>

View File

@ -4,7 +4,7 @@ import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
@SpringBootApplication
open class DemoApplication
class DemoApplication
fun main(args: Array<String>) {
SpringApplication.run(DemoApplication::class.java, *args)

View File

@ -10,10 +10,12 @@ buildscript {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath('io.spring.gradle:dependency-management-plugin:0.5.1.RELEASE')
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
}
}
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
apply plugin: 'io.spring.dependency-management'

View File

@ -55,6 +55,11 @@
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<configuration>
<compilerPlugins>
<plugin>spring</plugin>
</compilerPlugins>
</configuration>
<executions>
<execution>
<id>compile</id>
@ -71,6 +76,13 @@
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-allopen</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

View File

@ -10,10 +10,12 @@ buildscript {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath('io.spring.gradle:dependency-management-plugin:0.5.1.RELEASE')
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
}
}
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: 'eclipse-wtp'
apply plugin: 'spring-boot'
apply plugin: 'io.spring.dependency-management'

View File

@ -60,6 +60,11 @@
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<configuration>
<compilerPlugins>
<plugin>spring</plugin>
</compilerPlugins>
</configuration>
<executions>
<execution>
<id>compile</id>
@ -76,6 +81,13 @@
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-allopen</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

View File

@ -80,7 +80,7 @@ initializr:
gradle:
dependency-management-plugin-version: 0.6.0.RELEASE
kotlin:
version: 1.0.5-2
version: 1.0.6
dependencies:
- name: Core
content: