2016-03-06 75 views
3

在使用Java 8的项目中,joda-time是项目依赖项的传递依赖项。我想在项目源中强制使用java time而不是joda-timejoda-time类如何限制在Gradle项目的项目源中使用?Gradle:不要让项目源中使用的传递依赖项

+0

没有用它自己,但它听起来像[Checkstyle的'IllegalImports'(http://checkstyle.sourceforge.net/config_imports.html#IllegalImport)(或'ImportControl')选项应为此工作。 Gradle确实有[checkstyle插件](https://docs.gradle.org/current/userguide/checkstyle_plugin.html) – RaGe

回答

0

我还没有想出用gradle来做这件事的方法。但我正在使用IntelliJ的“排除导入和完成”功能作为解决方法。它不能完全解决问题,但有助于编码。我希望这有帮助。

Exclude from Import and Completion in IntelliJ

相关问题