Alice52 / kotlin-tutorial

kotlin tutorial and compare to java
https://github.com/Alice52/kotlin-tutorial/issues/2
MIT License
0 stars 0 forks source link

[env] setup #3

Open Alice52 opened 1 year ago

Alice52 commented 1 year ago

develop env setup

   <properties>
      <kotlin.compiler.incremental>false</kotlin.compiler.incremental>
      <kotlin.compiler.jvmTarget>17</kotlin.compiler.jvmTarget>
      <kotlin.version>1.9.0</kotlin.version>
      <kotlin.code.style>official</kotlin.code.style>
   </properties>

   <dependencies>
      <!-- kotlin -->
      <dependency>
         <groupId>org.jetbrains.kotlin</groupId>
         <artifactId>kotlin-stdlib</artifactId>
         <version>${kotlin.version}</version>
      </dependency>
   </dependencies>

   <build>
      <plugins>
         <plugin>
               <groupId>org.jetbrains.kotlin</groupId>
               <artifactId>kotlin-maven-plugin</artifactId>
               <version>${kotlin.version}</version>
               <configuration>
                  <compilerPlugins>
                     <plugin>lombok</plugin>
                  </compilerPlugins>
               </configuration>
               <executions>
                  <execution>
                     <id>compile</id>
                     <goals>
                           <goal>compile</goal>
                     </goals>
                     <configuration>
                           <sourceDirs>
                              <sourceDir>src/main/kotlin</sourceDir>
                              <sourceDir>src/main/java</sourceDir>
                           </sourceDirs>
                     </configuration>
                  </execution>
                  <execution>
                     <id>test-compile</id>
                     <goals>
                           <goal>test-compile</goal>
                     </goals>
                     <configuration>
                           <sourceDirs>
                              <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                              <sourceDir>${project.basedir}/src/test/java</sourceDir>
                           </sourceDirs>
                     </configuration>
                  </execution>
               </executions>
               <dependencies>
                  <dependency>
                     <groupId>org.jetbrains.kotlin</groupId>
                     <artifactId>kotlin-maven-lombok</artifactId>
                     <version>${kotlin.version}</version>
                  </dependency>
               </dependencies>
         </plugin>
      </plugins>
   </build>
Alice52 commented 1 year ago

troubling sheet

  1. idea 中 kotlin 的插件版本与 build/pom 文件中的不一致: 降低项目的版本 | 升级idea的插件 之后要invalid and restart