Add Kotlin (1.5.21) support for maven project

This commit is contained in:
Sambo Chea 2021-07-25 18:32:54 +07:00
parent 7d301af249
commit 5c3762cfdd

39
pom.xml
View File

@ -5,13 +5,14 @@
<!-- Vaadin project from https://start.vaadin.com/project/adc988bd-b0ed-4fc8-ba45-7df6875fb209 --> <!-- Vaadin project from https://start.vaadin.com/project/adc988bd-b0ed-4fc8-ba45-7df6875fb209 -->
<groupId>com.cubetiqs.fusion</groupId> <groupId>com.cubetiqs.fusion</groupId>
<artifactId>fusionmanagement</artifactId> <artifactId>fusionmanagement</artifactId>
<name>Project base for Spring Boot and Vaadin Flow</name> <name>CUBETIQ Vaadin Fusion Project</name>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<java.version>11</java.version> <java.version>11</java.version>
<vaadin.version>21.0.0.alpha10</vaadin.version> <vaadin.version>21.0.0.alpha10</vaadin.version>
<kotlin.version>1.5.21</kotlin.version>
</properties> </properties>
<parent> <parent>
@ -77,6 +78,15 @@
</dependencyManagement> </dependencyManagement>
<dependencies> <dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.vaadin</groupId> <groupId>com.vaadin</groupId>
<!-- Replace artifactId with vaadin-core to use only free components --> <!-- Replace artifactId with vaadin-core to use only free components -->
@ -122,6 +132,7 @@
<artifactId>spring-boot-devtools</artifactId> <artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
@ -153,6 +164,10 @@
</dependencies> </dependencies>
<build> <build>
<!-- Kotlin compiled source -->
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<defaultGoal>spring-boot:run</defaultGoal> <defaultGoal>spring-boot:run</defaultGoal>
<plugins> <plugins>
<plugin> <plugin>
@ -183,6 +198,28 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<!-- Kotlin plugin -->
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<configuration>
<args>
<arg>-Xjsr305=strict</arg>
</args>
<compilerPlugins>
<plugin>spring</plugin>
</compilerPlugins>
</configuration>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-allopen</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins> </plugins>
</build> </build>