2

I have a maven project with many demo classes with their own main methods, they don't dependent on each other. I used to be able to run a class by right clicking on its main method, and select Run MyClass.main(). But now instead of running it, it started to build the maven project as a whole.

enter image description here

Is there a way to "fix" this?

fall
  • 984
  • 11
  • 33

2 Answers2

2

IDE performs tasks that are set in Before launch section of the Run/Debug Configuration. By default the Build set is set there - which will build the all the sources which deletd on the code you are trying to run.

  1. You can remove the Build step from there and build the module alone from the module context menu of this module. See compile module for more description.
  2. Use Build, no error check step in Before launch section.
Andrey
  • 15,144
  • 25
  • 91
  • 187
  • Could you share a gif screenshot or a video? My Idea's version is 2020.3 and the UI might have changed. – fall Jan 23 '21 at 15:02
1

Check that in the settings the "Delegate IDE build..." is not selected:

project settings

P.J.Meisch
  • 18,013
  • 6
  • 50
  • 66