如何自动附加Intellij中的依赖源代码? [英] How to automatically attach source code for dependency in Intellij?

查看:131
本文介绍了如何自动附加Intellij中的依赖源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目(由Maven构建),它有许多内部的依赖关系;这些依赖关系中的一些是使用Maven构建的,并且源可以与中央存储库中的二进制文件(和Javadoc)一起部署;说这些是依赖性A.但是一些依赖关系没有源(作为存储库中的jar),并且不能被设置为在构建时部署源(巨大的Ant脚本,没有人想要破坏它);说这些是依赖关系B.



当使用Intellij进行调试时,我从这些依赖关系到达类,我想看到他们的源代码。 IDEA允许我选择下载源表单工件存储库(这仅适用于依赖关系A)或从本地文件夹附加它们。我有文件夹与源的依赖B和我总是设置该文件夹。



可以将Intellij设置为自动下载所有源(对于在存储库中具有源的依赖关系),或者如果不是,请将其附加到可配置的本地文件夹所有依赖项,何时加载项目?还是有插件?

解决方案

我恐怕不可能自动进行这样的配置。考虑将所有来源保留在Maven存储库中,在这种情况下,您可以配置IDEA自动下载。


I have a project (built with Maven) which has many internal dependencies; some of these dependencies are built with Maven and sources can be deployed along with the binaries (and Javadoc) in the central repository; say these are dependencies A. But some dependencies do not have sources (as jar in repository) and cannot be set to be deployed with sources when built (huge Ant script and no one wants to break it); say these are dependencies B.

When debugging with Intellij, I reach classes from these dependencies and I want to see their source code. IDEA lets me choose to download the sources form artifacts repository (this only works for dependencies A) or to attach them from a local folder. I have the folder with the sources for dependencies B and I always set that folder.

Can Intellij be set to automatically download all the sources (for dependencies that have sources in repository) or, if not, to attach them from configurable local folder(s) for all the dependencies, when a project is loaded? Or is there a plug-in for this?

解决方案

I'm afraid it's not possible to do such configuration automatically. Consider keeping all the sources in the Maven repository, in this case you can configure IDEA to download them automatically.

这篇关于如何自动附加Intellij中的依赖源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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