官术网_书友最值得收藏!

Using the no-org plugin in Maven

Using the no-org compiler plugin is the same as the all-open plugin. The kotlin-maven-noarg dependency has to be added to the pom.xml file and we specify the plugin in the plugin section:

<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>
</plugin>

<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>

<configuration>
<compilerPlugins>
<plugin>no-arg</plugin>
</compilerPlugins>

<pluginOptions>
<option>no-arg:annotation=org.rao.kotlin.javaee.MyClass</option>
<!-- <option>no-arg:invokeInitializers=true</option> -->
</pluginOptions>
</configuration>

<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-noarg</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin>
主站蜘蛛池模板: 孝义市| 高邑县| 历史| 伽师县| 突泉县| 含山县| 遂宁市| 陆丰市| 衡东县| 贵港市| 浠水县| 安义县| 尚志市| 荃湾区| 历史| 东台市| 青冈县| 大名县| 沈丘县| 西林县| 方城县| 湄潭县| 雷波县| 呼伦贝尔市| 鸡西市| 麦盖提县| 宣威市| 平原县| 吴江市| 五原县| 长丰县| 巴塘县| 嘉定区| 阿勒泰市| 无为县| 横峰县| 于田县| 萍乡市| 漳浦县| 樟树市| 桓台县|