I got started with Spring Boot with Kotlin by foll...
# spring
j
I got started with Spring Boot with Kotlin by following this tutorial https://spring.io/guides/tutorials/spring-boot-kotlin/. I am getting this message in IntelliJ as the attached image. Through searching, I read that this would not happen if
jpa
plugin is installed, but when I checked
build.gradle.kts
the
jpa
plugin was of course already installed, since I was following the steps in the tutorial.
Copy code
plugins {
    id("org.springframework.boot") version "2.2.6.RELEASE"
    id("io.spring.dependency-management") version "1.0.9.RELEASE"
    kotlin("jvm") version "1.3.71"
    kotlin("plugin.spring") version "1.3.71"
    kotlin("plugin.jpa") version "1.3.71"
    kotlin("plugin.allopen") version "1.3.71"
}
So what am I missing here?
I edited the kotlin plugins’ version from “1.3.71” to “1.3.70", and the message disappeared.
Could it be that it’s related to this issue: https://youtrack.jetbrains.com/issue/KT-36964, and the false positive is again caused?
No, actually after some while IntelliJ again showed the message
But I am able to build and run, either with version “1.3.71” or “1.3.70". So this does seem like a false positive
l
hibernate entity needs a no-arg constructor. use the kotlin noarg plugin (https://plugins.gradle.org/plugin/org.jetbrains.kotlin.plugin.noarg) or make it like
Copy code
@Entity
class Article {
  var id: Long = 0
  var name: String = ""
  var desc: String? = null
}
j
@leodeng I think that’s automatically done via the jpa plugin, and that seems true since when I checked the project structure, it showed this:
l
hmm, i think you’re right about jpa plugin also applies the noarg plugin. i guess if you run gradle in command line, everything works fine? could it be the intellij version?
j
@leodeng Yes, IntelliJ complains, but I was still able to build and run the app.
l
i can only think of a few things to try but am not sure if those will help, like: update intellij to the latest version, enable annotation processing, change gradle runner to Gradle instead of IntelliJ IDEA