I believe I've configured the Kotlin Maven plugin to read the annotations generated for me by kannotator:
When I run the Kotlin Maven compiler, it picks this up:
[INFO] Using kotlin annotations from /Users/ian/.m2/repository/org/jetbrains/kotlin/kotlin-jdk-annotations/0.5.748/kotlin-jdk-annotations-0.5.748.jar:annotations
Here are the relevant annotations: https://github.com/sanity/preddit/tree/master/annotations
Kannotator has correctly determined that the HttpServlet.doGet() method’s paramters are not null: https://github.com/sanity/preddit/blob/master/annotations/Maven:%20javax.servlet:servlet-api:2.5/javax/servlet/http/annotations.xml#L15
Because of this, IDEA requires that I use the override keyword when overriding this method, as it should: https://github.com/sanity/preddit/blob/master/src/main/kotlin/preddit/FrontPage.kt#L9
The problem is that when I try a “mvn compile” from the command line, I get the following error:
[ERROR] /Users/ian/workspace/preddit/src/main/kotlin/preddit/FrontPage.kt: (9, 15) ‘doGet’ overrides nothing
I assume this is because the Kotlin Maven compiler isn’t seeing that this method’s parameters are not nullable, even though IDEA itself has no problem with it (indeed, it requires it). When I delete the annotations directory and use nullable paramters for the method, it compiles fine.
Can anyone suggest what is wrong here?