给定一个具有如下依赖关系的 build.gradle
:
dependencies {
compile fileTree(dir: 'myLegacyLibsNotYetConverted/lib', include: '*.jar')
compile fileTree(dir: 'myOtherLegacyLibsNotYetConverted/lib', include: '*.jar')
compile 'org.springframework:spring-tx:3.1.2.RELEASE'
compile 'org.springframework:spring-jms:3.1.2.RELEASE'
compile 'org.springframework:spring-jdbc:3.1.2.RELEASE'
(...)
testCompile "junit:junit:4.11"
testCompile fileTree(dir: "legacyBuild/test-lib", include: "*.jar")
(...)
providedCompile "javax.servlet:servlet-api:2.5"
providedCompile "javax.servlet.jsp:jsp-api:2.2"
}
将它们添加到 IntelliJ 的 IDE 的类路径中的最简单/推荐的方法是什么,以便我所有的交互式编译器和测试都具有它们需要的所有类依赖项?是否可以在每次更改时同步它?
一个灵活的解决方案,只需稍作改动即可在 Eclipse 中工作,我们也将不胜感激。
最佳答案
假设您已经安装了 Gradle 插件(首选项>插件>安装 JetBrains 插件>Gradle),使用 IntelliJ 12,只需单击 Refresh Gradle Project 即可将所有依赖项放入您的类路径中。
关于java - 将 Gradle 依赖项添加到 IntelliJ 编译器类路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20087901/