Could “attach source” be made easier for popular Java libraries?

前端 未结 5 2112
我寻月下人不归
我寻月下人不归 2021-02-11 05:06

I run into this obstacle when my debugger steps into some classfile without corresponding source. Finding it is often difficult:

  • You have to search for the sit

5条回答
  •  北荒
    北荒 (楼主)
    2021-02-11 05:45

    Both m2eclipse and IDEA will download the sources and javadocs for any dependencies. The m2eclipse sources can be downloaded by right-clicking on a dependency (or the whole project if you want all sources) and clicking Maven->Download Sources.

    download sources screenshot

    On newer versions of m2eclipse you can also automatically download sources by going to Window->Preferences...->Maven, then selecting the "Download Artifact Sources" option. When you open a type in a dependency jar that there are currently no sources available for, Maven will download the sources in the background and update the source attachment in the background.

    Maven preferences screenshot

提交回复
热议问题