当javadoc不附加到依赖关系时,如何将javadocs引用到Maven的eclipse插件中的依赖关系 [英] How to reference javadocs to dependencies in Maven's eclipse plugin when javadoc not attached to dependency
问题描述
有没有办法配置Maven的eclipse插件来自动添加运行Maven的eclipse插件时javadoc的classpath属性?
我只对没有为maven存储库中的依赖关系提供javadoc和/或源的答案感兴趣,这对我来说最常见。使用downloadSources和/或downloadJavadocs属性不会帮助这个问题。
您可能会考虑通过安装使用安装文件目标手动将javadoc jar手动导入本地资源库并传入-Dclassifier = javadoc选项。一旦你这样做,mvn生成的.classpath应该是正确的。
如果你使用远程repo作为中央的代理,你还可以将javadoc部署到该repo和那么使用该代理的所有其他人都将自动获取javadoc。
I use Eclipse, Maven, and Java in my development. I use Maven to download dependencies (jar files and javadoc when available) and Maven's eclipse plug-in to generate the .project and .classpath files for Eclipse. When the dependency downloaded does not have attached javadoc I manually add a link for the javadoc in the .classpath file so that I can see the javadoc for the dependency in Eclipse. Then when I run Maven's eclipse plugin to regenerate the .classpath file it of course wipes out that change.
Is there a way to configure Maven's eclipse plug-in to automatically add classpath attributes for javadoc when running Maven's eclipse plug-in?
I'm only interested in answers where the javadoc and/or sources are not provided for the dependency in the maven repository, which is the case most often for me. Using downloadSources and/or downloadJavadocs properties won't help this problem.
You might consider just avoiding this problem completely by installing the javadoc jar into your local repository manually using the install-file goal and passing in the -Dclassifier=javadoc option. Once you do that the .classpath that mvn generates should be correct.
If you use a remote repo as a proxy to central you could also deploy the javadocs to that repo and then everyone else who uses that proxy will now get the javadocs automatically as well.
这篇关于当javadoc不附加到依赖关系时,如何将javadocs引用到Maven的eclipse插件中的依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!