Debug into Maven Dependency Source w/IntelliJ

Tyson picture Tyson · May 27, 2013 · Viewed 6.9k times · Source

I'm debugging a Maven project in IntelliJ and I'm trying to figure out how to step into the source of one of my dependencies that's specified in my pom.xml. Specifically, my project has a dependency on Crawler4J I'm seeing some weird behaviour from Parser.parse(), and I want to step thru that method. I tried setting up a local cloned Git repo with the source and attaching it via the Sources option under Project Structure, but I still can't step into the compiled Crawler4J methods. As a long time C# developer (and relative Java nub) what I would have ideally liked is something like .NET Reflector's functionality for decompiling on the fly while debugging, but a way to attach the source would suffice.

Answer

maba picture maba · May 28, 2013

I just set up the same dependency and I have no problems to download the source code.

enter image description here

Now I created a simple Main class with a Parser. I do Ctrl + Left-click and it will bring me to the Parser class.

enter image description here

As you can see it has a link in the upper right corner saying Download Sources.

enter image description here

After pressing that link the sources are downloaded and immediately available.

enter image description here