当javadoc不附加到依赖关系时,如何将javadocs引用到Maven的eclipse插件中的依赖关系 [英] How to reference javadocs to dependencies in Maven's eclipse plugin when javadoc not attached to dependency

查看:245
本文介绍了当javadoc不附加到依赖关系时,如何将javadocs引用到Maven的eclipse插件中的依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发中使用Eclipse,Maven和Java。我使用Maven下载依赖项(可用的jar文件和javadoc)和Maven的eclipse插件来为Eclipse生成.project和.classpath文件。当下载的依赖关系不附加javadoc时,我手动添加.classpath文件中的javadoc的链接,以便我可以在Eclipse中看到依赖关系的javadoc。那么当我运行Maven的eclipse插件来重新生成.classpath文件时,它当然会消除这个变化。



有没有办法配置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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆