Eclipse 插件似乎使用以下机制来执行此操作:
apply plugin: 'java'
apply plugin: 'eclipse'
eclipse {
classpath {
downloadSources=true
}
}
但我找不到idea插件对应的选项。我错过了什么?
这是 build.gradle 文件:
apply plugin: 'groovy'
apply plugin: 'idea'
repositories {
mavenCentral()
mavenRepo name: "Grails", url: "http://repo.grails.org/grails/repo/"
}
dependencies {
groovy 'org.codehaus.groovy:groovy-all:2.0.4'
compile 'org.slf4j:slf4j-log4j12:1.6.6', 'postgresql:postgresql:9.1-901.jdbc4', 'net.sourceforge.nekohtml:nekohtml:1.9.16'
['core', 'hibernate', 'plugin-datasource', 'plugin-domain-class'].each { plugin ->
compile "org.grails:grails-$plugin:2.1.0"
}
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
// Fat Jar Option (http://docs.codehaus.org/display/GRADLE/Cookbook#Cookbook-Creatingafatjar)
jar {
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
task wrapper(type: Wrapper) {
gradleVersion = '1.0'
}
最佳答案
我在使用以下配置时遇到问题:
idea { module { // if you hate browsing Javadoc downloadJavadoc = false // and love reading sources :) downloadSources = true } } repositories { mavenLocal() mavenCentral() }
删除后,mavenLocal()
源已下载并附加。
关于intellij-idea - 如何在IDEA中下载Gradle项目的依赖源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12718753/