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

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>
主站蜘蛛池模板: 河津市| 普安县| 平泉县| 舟曲县| 城步| 华坪县| 河源市| 保康县| 铁岭县| 融水| 固原市| 彭山县| 信宜市| 杭州市| 读书| 济宁市| 常州市| 鹿泉市| 卓尼县| 抚松县| 万州区| 固阳县| 蕲春县| 泾阳县| 甘孜| 凌海市| 阿拉善右旗| 大渡口区| 柯坪县| 静安区| 江油市| 尉氏县| 临沂市| 安福县| 瑞昌市| 泽州县| 治多县| 文山县| 旌德县| 教育| 长海县|