使用kotlin-maven-plugin进行注释处理

所以我有2个模块的maven项目。

root pom.xml看起来像这样:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>kashier</groupId> <artifactId>Kashier</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <modules> <module>AnnotationProcessing</module> <module>TestProject</module> </modules> 

AnnotationProcessing模块的pom.xml:

 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>kashier</groupId> <artifactId>Kashier</artifactId> <version>1.0-SNAPSHOT</version> </parent> <artifactId>AnnotationProcessing</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <properties> <kotlin.version>1.0.3</kotlin.version> </properties> <dependencies> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-stdlib</artifactId> <version>${kotlin.version}</version> </dependency> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-test</artifactId> <version>${kotlin.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>com.google.auto.service</groupId> <artifactId>auto-service</artifactId> <version>1.0-rc2</version> <optional>true</optional> </dependency> </dependencies> <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> </plugin> </plugins> </build> 

现在一切工作正常只有当我手动创建资源目录中的javax.annotation.processing.Processor文件。 这意味着汽车服务不起作用,问题是:我如何使它工作?

此外,我试图使用java的同一个项目,它的工作原理。 所以我认为这个问题是在kotlin-maven-plugin中。

项目的源代码可以在这里找到