bash
mn create-app micronaut-example --features kotlin --build maven
HelloController as indicated by the docsapplication.yml filemain method from inside Intellijhttp test in Intellij, i.e. create a file called test.http with the following content:http
GET http://localhost:8080/hello
Accept: */*
test.httpExpecting the HelloController to return "Hello World"
GET http://localhost:8080/hello
HTTP/1.1 404 Not Found
Date: Fri, 29 Jun 2018 09:11:14 GMT
content-type: application/json
content-length: 82
{
"_links": {
"self": {
"href": "/hello",
"templated": false
}
},
"message": "Page Not Found"
}
Response code: 404 (Not Found); Time: 269ms; Content length: 82 bytes
Note that it works if I run the jar file manually from the command-line after having executed mvn clean install.
Please see the section https://docs.micronaut.io/latest/guide/index.html#kotlin under "Kotlin, Kapt and IntelliJ"
Hopefully IntelliJ will add direct support in the future for Kapt without requiring an external build step
Thanks a lot for the fast reply. One suggestion might be to include this link in the guide. I assume that most people, like me, just read the guide and assume it to work.
Thanks for the feedback, will get it done.
@graemerocher - The guides talk about IntelliJ configuration for gradle. Anything has to be done for maven? I enabled annotation processing but running into the same problem as in this issue. Doing it through command line maven works fine, but running Application.kt through IntelliJ will not work until and unless I run it through the command line first.
Edit: Never mind. I am running the the maven install command through intellij just like the gradle "classes" task. I get this these warnings though.
[WARNING] 'tools.jar' was not found, kapt may work unreliably
[INFO] Applied plugin: 'all-open'
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jetbrains.kotlin.kapt3.base.javac.KaptJavaFileManager (file:/Users/satb/.m2/repository/org/jetbrains/kotlin/kotlin-annotation-processing-maven/1.3.0/kotlin-annotation-processing-maven-1.3.0.jar) to method com.sun.tools.javac.file.BaseFileManager.handleOption(com.sun.tools.javac.main.Option,java.lang.String)
WARNING: Please consider reporting this to the maintainers of org.jetbrains.kotlin.kapt3.base.javac.KaptJavaFileManager
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[WARNING] warning: Supported source version 'RELEASE_8' from annotation processor 'org.jetbrains.kotlin.kapt3.base.ProcessorWrapper' less than -source '1.9'
[WARNING] warning: Supported source version 'RELEASE_8' from annotation processor 'org.jetbrains.kotlin.kapt3.base.ProcessorWrapper' less than -source '1.9'
[WARNING] warning: Supported source version 'RELEASE_8' from annotation processor 'org.jetbrains.kotlin.kapt3.base.ProcessorWrapper' less than -source '1.9'
Edit 2: Looks like java 9 isn't supported with kapt? Wow! Oracle is dropping support for java 8 and we still cannot move past it. Dropping to java 8 on the "Maven Runner" of IntelliJ made those warnings go away
I've observed that the memory requirements for a single hello world controller example is 165 MB on the Mac with Kotlin. Is that normal? To me it looks a little on the high side.
Most helpful comment
@graemerocher - The guides talk about IntelliJ configuration for gradle. Anything has to be done for maven? I enabled annotation processing but running into the same problem as in this issue. Doing it through command line maven works fine, but running Application.kt through IntelliJ will not work until and unless I run it through the command line first.
Edit: Never mind. I am running the the maven install command through intellij just like the gradle "classes" task. I get this these warnings though.
Edit 2: Looks like java 9 isn't supported with kapt? Wow! Oracle is dropping support for java 8 and we still cannot move past it. Dropping to java 8 on the "Maven Runner" of IntelliJ made those warnings go away
I've observed that the memory requirements for a single hello world controller example is 165 MB on the Mac with Kotlin. Is that normal? To me it looks a little on the high side.