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.
Asked
Active
Viewed 9,326 times
7
-
1With IntelliJ's maven support you can download and attach the sources on-the-fly - this should work out of the box. Did you import the project as a maven project (so that Idea nows about the pom)? – dratewka May 27 '13 at 18:47
-
Oh, and you can also [decompile](http://plugins.jetbrains.com/plugin/7100) but downloading the original sources is a better approach for maven artifacts. – dratewka May 27 '13 at 18:49
-
Thanks! You're correct, as the answer below indicates as well. I appreciate the help. The decompile pointer may come in handy at some point as well. – Tyson Jun 04 '13 at 04:02
1 Answers
5
I just set up the same dependency and I have no problems to download the source code.
Now I created a simple Main class with a Parser. I do Ctrl + Left-click and it will bring me to the Parser class.
As you can see it has a link in the upper right corner saying Download Sources
.
After pressing that link the sources are downloaded and immediately available.

maba
- 47,113
- 10
- 108
- 118
-
1Thanks, this worked for me too. For some reason I wasn't initially shown the "Download Sources" option. Appreciate the help! – Tyson Jun 04 '13 at 03:59