Is kapt supported in maven?

Is it possible to run kapt (kotlin annotation processing) in a maven based project?

If so, how do I integrate kapt into the maven build system?

+4
source share
1 answer

Since Kotlin 1.1.2 now supports both Gradle and Maven to run KAPT plugins. This is described in Using the Kotlin Annotation Processing Tool , which states:

Add target compilation from kotlin-maven-plugin before compilation:

<execution> <id>kapt</id> <goals> <goal>kapt</goal> </goals> <configuration> <sourceDirs> <sourceDir>src/main/kotlin</sourceDir> <sourceDir>src/main/java</sourceDir> </sourceDirs> <annotationProcessorPaths> <!-- Specify your annotation processors here. --> <annotationProcessorPath> <groupId>com.google.dagger</groupId> <artifactId>dagger-compiler</artifactId> <version>2.9</version> </annotationProcessorPath> </annotationProcessorPaths> </configuration> </execution> 
+3
source

Source: https://habr.com/ru/post/1237517/


All Articles