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

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>
主站蜘蛛池模板: 千阳县| 厦门市| 南部县| 济阳县| 三台县| 平昌县| 曲麻莱县| 兴宁市| 麻城市| 阿拉善盟| 辰溪县| 乡宁县| 鸡泽县| 炎陵县| 镇平县| 会东县| 东港市| 射洪县| 元阳县| 阿鲁科尔沁旗| 新绛县| 乌拉特中旗| 潢川县| 阳春市| 新津县| 大余县| 宁德市| 顺昌县| 东港市| 京山县| 昭通市| 岳阳市| 邹平县| 翼城县| 苍梧县| 福鼎市| 涞源县| 贺州市| 青田县| 高台县| 达州市|