Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij Debugging picking up old version project files

I am debugging code in Intellij. I use maven to build the project and there are various versions of the project sitting in the local .m2 repository. Intellij keeps on picking the old version of the code from the previous snapshot of the project when I start debugging. How do I make IntelliJ debug the latest code from the local repository?

like image 421
MindBrain Avatar asked Sep 23 '13 21:09

MindBrain


People also ask

Can you step back in IntelliJ debugger?

You can do step back in some situations in IntelliJ. From the official documentation: Interrupts execution and returns to the initial point of method execution. In the process, it drops the current method frames from the stack.

What is drop frame in IntelliJ debug?

IntelliJ IDEA lets you fall back to a previous stack frame in a program's execution flow. This can be useful, for example, if you've mistakenly stepped too far, or want to re-enter a method where you missed a critical spot. Click the Drop Frame icon. on the toolbar of the Debug tool window.

How do I move from one debug point to another in IntelliJ?

From the main menu, select Run | Debugging Actions | Smart Step Into or press Shift+F7 . Click the method. You can also select it using the arrow keys or tabs and press Enter / F7 .


2 Answers

You can tell Intellij 2016 to ask you each time which source code to step through. File->Settings->Debugger

Show alternative source switcher

Show alternative source switcher

like image 89
Demian Avatar answered Sep 21 '22 05:09

Demian


  1. Try removing .jar and .war files that contain your code from your ~/.m2/repository/ For me the issue is that I built something and it is now registered in Maven under what Maven considers a newer version, but isn't what I was currently working on. I compiled, say, version "2.1" to debug something and then went back to working on "sand-box-idea-SNAPSHOT". I keep thinking why isn't Intellij picking up my latest sand box change but it's because it's deferring to the Maven version 2.1 which Maven assumes is better than 'sand-box-SNAPSHOT'.

  2. It may be that you have some plug-ins interfering with IntelliJ's build process. I know that the Google Protocol Buffers Plugin can cause my Intellij to be unable to detect dirty classes that need to be re-compiled.

like image 24
Kirby Avatar answered Sep 21 '22 05:09

Kirby