|
@@ -16,6 +16,9 @@
|
|
|
<properties>
|
|
|
<java.version>1.8</java.version>
|
|
|
<druid.version>1.1.10</druid.version>
|
|
|
+ <!-- 添加 Kotlin 版本属性 -->
|
|
|
+ <kotlin.version>2.1.0</kotlin.version>
|
|
|
+
|
|
|
</properties>
|
|
|
<dependencies>
|
|
|
<!--工具类 -->
|
|
@@ -248,6 +251,21 @@
|
|
|
</systemPath>
|
|
|
</dependency>
|
|
|
|
|
|
+
|
|
|
+ <!-- 添加 Kotlin 标准库 -->
|
|
|
+ <dependency>
|
|
|
+ <groupId>org.jetbrains.kotlin</groupId>
|
|
|
+ <artifactId>kotlin-stdlib-jdk8</artifactId>
|
|
|
+ <version>${kotlin.version}</version>
|
|
|
+ </dependency>
|
|
|
+
|
|
|
+ <!-- 添加 Kotlin 反射库 -->
|
|
|
+ <dependency>
|
|
|
+ <groupId>org.jetbrains.kotlin</groupId>
|
|
|
+ <artifactId>kotlin-reflect</artifactId>
|
|
|
+ <version>${kotlin.version}</version>
|
|
|
+ </dependency>
|
|
|
+
|
|
|
</dependencies>
|
|
|
|
|
|
<dependencyManagement>
|
|
@@ -264,6 +282,51 @@
|
|
|
|
|
|
<build>
|
|
|
<plugins>
|
|
|
+
|
|
|
+ <plugin>
|
|
|
+ <groupId>org.jetbrains.kotlin</groupId>
|
|
|
+ <artifactId>kotlin-maven-plugin</artifactId>
|
|
|
+ <version>${kotlin.version}</version>
|
|
|
+ <executions>
|
|
|
+ <execution>
|
|
|
+ <id>compile</id>
|
|
|
+ <phase>compile</phase>
|
|
|
+ <goals>
|
|
|
+ <goal>compile</goal>
|
|
|
+ </goals>
|
|
|
+ </execution>
|
|
|
+ <execution>
|
|
|
+ <id>test-compile</id>
|
|
|
+ <phase>test-compile</phase>
|
|
|
+ <goals>
|
|
|
+ <goal>test-compile</goal>
|
|
|
+ </goals>
|
|
|
+ </execution>
|
|
|
+ </executions>
|
|
|
+ <configuration>
|
|
|
+ <jvmTarget>${java.version}</jvmTarget>
|
|
|
+ <args>
|
|
|
+ <arg>-Xjsr305=strict</arg> <!-- 启用严格的空安全检查 -->
|
|
|
+ </args>
|
|
|
+ </configuration>
|
|
|
+ </plugin>
|
|
|
+
|
|
|
+ <!-- 确保 Kotlin 编译在 Java 之前 -->
|
|
|
+ <plugin>
|
|
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
+ <artifactId>maven-compiler-plugin</artifactId>
|
|
|
+ <version>3.8.1</version>
|
|
|
+ <executions>
|
|
|
+ <execution>
|
|
|
+ <id>compile</id>
|
|
|
+ <phase>compile</phase>
|
|
|
+ <goals>
|
|
|
+ <goal>compile</goal>
|
|
|
+ </goals>
|
|
|
+ </execution>
|
|
|
+ </executions>
|
|
|
+ </plugin>
|
|
|
+
|
|
|
<plugin>
|
|
|
<groupId>org.springframework.boot</groupId>
|
|
|
<artifactId>spring-boot-maven-plugin</artifactId>
|