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

前端 未结 5 2113
我寻月下人不归
我寻月下人不归 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:31

    it may be complicated but it is worth the initial effort.

    i do it the following way: in my project directory i have three major directories,

    • src (my own)
    • lib
    • suppl (sources / javadocs when no sources exist)

    i put in suppl one zip file per library, containing the sources. in intellij this gives me not only debugger superpowers, but also javadocs.

    you are right, obtaining the sources is a pain. sometimes the sources come deliveded in the .jar file of the lib, sometimes as a seperate download (my favorite) and sometimes i have to create a seperate cvs/svn dir where i can checkout the sources. i usually need to re-package them the way i like them, even if provided in a zip.

    i am sceptical about maven. i just don't like to hand over my decisions about choosing libs to a program.

提交回复
热议问题