IntelliJ does not recognize Java library in Kotlin file

已回答

I have an own Java library: https://github.com/skycavemc/skycavelib which I am importing in a Kotlin project. The library is listed in External Libraries and I can import it in Java files.

However, when I import any class from the library in a Kotlin file, IntelliJ cannot resolve the import. Gradle builds successfully (also from the command line), but everything is highlighted red ("Unresolved reference"). Other Java libraries, such as Apache commons lang, work just fine.

I've already tried invalidating caches and reloading the gradle project, but none of that helped. It's also across all Kotlin projects, not specific for one.

Thank you in advance,

Leon

评论操作 固定链接

Fixed it by not shadowing the dependencies into the artifact pushed onto maven.

1

请先登录再写评论。