In a project using Java 8, joda-time
is a transitive dependency of a project dependency. I want to enforce use of java time
instead of joda-time
in project source. How can joda-time
classes be restricted to be used in project source in a gradle project?
Asked
Active
Viewed 79 times
3

TheKojuEffect
- 20,103
- 19
- 89
- 125
-
Haven't used it myself, but it sounds like [Checkstyle `IllegalImports`](http://checkstyle.sourceforge.net/config_imports.html#IllegalImport) (or `ImportControl`) option should work for this. Gradle does have a [checkstyle plugin](https://docs.gradle.org/current/userguide/checkstyle_plugin.html) – RaGe Mar 06 '16 at 17:29
1 Answers
0
I haven't figured out the way to do this with gradle. But I am using IntelliJ's "Exclude from Import and Completion" feature as a workaround. It doesn't completely solves the problem but helps while coding. I hope it was helpful.

TheKojuEffect
- 20,103
- 19
- 89
- 125