我的 Gradle 项目正在从文件中提取一些 jar 依赖项,如下所示:
dependencies {
compile fileTree(dir: 'lib', include: '*.jar')
}
我已将其中一个依赖项的 Javadoc 下载为 zip 文件,如何在 Eclipse 中添加 Javadoc?
当我右键单击 Gradle 依赖项并尝试添加 Javadoc 时,我看到:
The current class path entry belongs to container 'Gradle Dependencies (persisted)' which does not allow user modifications to Javadoc locations on its entries.
最佳答案
对于文件 jar 来说可能有点复杂。但是,如果您能够从 repo 获取依赖项,那么这就是要走的路:
repositories {
mavenCentral()
}
dependencies {
compile 'javax.servlet:javax.servlet-api:3.1.0'
}
eclipse.classpath.downloadJavadoc = true
eclipse.classpath.downloadSources = false
我做完之后
gradle cleanEclipse eclipse
我在 .classpath
中得到了类似的信息:<classpathentry kind="lib" path="C:/.../javax.servlet-api-3.1.0.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/C:/.../javax.servlet-api-3.1.0-javadoc.jar!/"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
关于eclipse - 如何在 Eclipse 中为 Gradle 依赖项附加 Javadoc?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30108349/