How do I attach source code into a project's library in Eclipse?

独自空忆成欢 提交于 2019-12-02 01:36:50

First of all, there's nothing to be debuged at @Autowire is just an annotation. The only thing you will see there is its attributes. That's it. The interesting code is in AutowiredAnnotationBeanPostProcessor.java

Anyways, if you want to attach source zips to a jar. In Eclipse is as easy as:

  1. Your Project (Right Click) > Preference
  2. Select Java Build path (Left menu) > Libraries (Tab)
  3. Look for the jar an do click on its arrow
  4. Select source attachement

Here an example of the process.

If you are insterested on how Annotations works. I suggest this tutorial Java Tutorial - Annotations.

Do this: Your Project (Right Click) -> Debug As -> Debug Configuration -> Source Tab

or Go to package explorer and right click and Java source attachment.

Or Use maven M2E plugin.

  1. if it's a maven project , use "mvn dependency:sources" to download all jar-sources, else download by other way
  2. attach java sources one by one,look pictrue,:) but you will think it's too tired when you have many libraries,you can also use "java source attacher" plugins in eclipse marketplace to attach sources automatic
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!