Kapt maven goal fails with plugin dependencies


#1

Using kotlin 1.1.2-4

This is what my working plugin looks like

<plugin>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-maven-plugin</artifactId>
            <version>${kotlin.version}</version>
            <executions>
               <execution>
                    <id>kapt</id>
                    <goals>
                        <goal>kapt</goal>
                    </goals>
                    <configuration>
                        <sourceDirs>
                            <sourceDir>${project.basedir}/src/main/java</sourceDir>
                        </sourceDirs>
                        <annotationProcessors>
                            <annotationProcessor>com.querydsl.apt.QuerydslAnnotationProcessor</annotationProcessor>
                        </annotationProcessors>
                    </configuration>
                </execution>
                <execution>
                    <id>compile</id>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                    <configuration>
                        <sourceDirs>
                            <sourceDir>${project.basedir}/src/main/java</sourceDir>
                        </sourceDirs>
                    </configuration>
                </execution>
                <execution>
                    <id>test-compile</id>
                    <goals>
                        <goal>test-compile</goal>
                    </goals>
                    <configuration>
                        <sourceDirs>
                            <sourceDir>${project.basedir}/src/test/java</sourceDir>
                        </sourceDirs>
                    </configuration>
                </execution>
            </executions>
            <dependencies>
               
            </dependencies>

        </plugin>

This runs, creates the generated classes for QueryDSL, all is good.

However, if I add a dependency (in this case the kotlin-maven-noarg plugin), even if I do not activate the plugin in the compiler configuration, I get a compilation failure with a lot of unresolved references related to the generated classes I was trying to generate.

Has anyone else experienced this at all?


#2

I’m having the same problems. Thinking about giving up kotlin, interoperability with Java does not work.
If you add any processor in kapt the plugins will crash.
If you use springboot and add a processor springboot: run does not work either. You really do not have to waste time.


#3

If you add dependency to plugin, for example all-open, kapt does not work. I dont know what to do anymore. Go back to Java8 + Lombok :frowning:


#4

Found a bug for this: https://youtrack.jetbrains.com/issue/KT-18022
It marked as “fixed in 1.1.4”, and there are indeed commit was made, but according to my test, it still not working in 1.1.4-3 (or I doing something wrong)