Closed dkorobtsov closed 5 years ago
I'm seeing this same issue on upgrade from Gradle 4.10 to Gradle 5.2.1, we're not using the kotlin DSL at all, and because we're running with -Werror
this is breaking now.
Build time: 2019-02-08 19:00:10 UTC Revision: f02764e074c32ee8851a4e1877dd1fea8ffb7183
Kotlin DSL: 1.1.3 Kotlin: 1.3.20 Groovy: 2.5.4 Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018 JVM: 1.8.0_144 (Oracle Corporation 25.144-b01) OS: Mac OS X 10.13.6 x86_64
It's a bit hard to get why kotlin.DeprecationLevel
would be searched for. Could you please provide a complete reproducer?
@eskatos btw, figured out the root cause. Issue reproduces when in Java project dependencies contain some library written in Kotlin that has @Deprecated annotations. In my particular case root cause was recent okio update - when biggest part of okio library was switched to Kotlin (including deprecations):
Check this class for example: https://github.com/square/okio/blob/2b65a6cb391ebc93c324d5d3a4d6cdc056bf47e7/okio/jvm/src/main/java/okio/ByteString.kt
So, steps to reproduce are pretty simple:
Workaround: adding kotlin std-lib to classpath solves the issue. Still - adding it if Kotlin is not used in particular project at all only to suppress exception feels like overkill.
All in all, issue is not related to Kotlin DSL. Any ideas where this ticket should go instead?
The okio artifact doesn't expose its dependency on kotlin-stdlib
but it apparently leaks some kotlin-stdlib types like kotlin.Deprecated
, hence the class file for kotlin.DeprecationLevel not found
messages from javac
and javadoc
. @dkorobtsov, please report against okio.
@scumbkt19, could you please confirm that what you are experiencing has a similar cause?
ooo, that makes a lot of sense, mine is coming from okhttp, which probably traces back to that same lib.
Created https://github.com/square/okio/issues/562, sounds like closing this ticket is appropriate
Thank you for confirming.
Expected Behavior
compileJava and javaDoc tasks should show deprecation warnings (if any is found)
Current Behavior
compileJava and javaDoc tasks show following warnings instead: warning: unknown enum constant DeprecationLevel.WARNING reason: class file for kotlin.DeprecationLevel not found warning: unknown enum constant DeprecationLevel.ERROR warning: unknown enum constant DeprecationLevel.ERROR warning: unknown enum constant DeprecationLevel.WARNING warning: unknown enum constant DeprecationLevel.ERROR warning: unknown enum constant DeprecationLevel.ERROR 6 warnings
Context
No functional impact, just annoying - build log is red.
Steps to Reproduce (for bugs)
Compiling only java sources. Gradle build configured in Kotlin DSL. Tasks configuration:
Btw, adding following compiler args suppresses warnings for CompileJava task:
But nothing helps with Javadoc.
Your Environment
Gradle 5.1-rc-1
Build time: 2018-12-13 06:00:04 UTC Revision: 0937d57caa43dabc31d331dea6c9c0cf72de8607
Kotlin DSL: 1.1.0 Kotlin: 1.3.11 Groovy: 2.5.4 Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018 JVM: 1.8.0_172 (Oracle Corporation 25.172-b11) OS: Mac OS X 10.14.2 x86_64
IntelliJ IDEA 2018.3.1 (Ultimate Edition) Build #IU-183.4588.61, built on December 4, 2018
Kotlin plugin: v1.3.11-release-IJ2018.3-1