Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run unit test in IntelliJ when some modules are not compiling?

I've been given a legacy project to quickly fix a bug. It is an ant-based project, so I've imported it into intellij using eclipse files. Project has several modules and some of them are not compiling correctly. What I'd like to do is:

I have my module I need to work on compiling and I need to write some unit tests to cover my changes. But I'm not able to run those tests because of the other modules not compiling. I can't remove those modules from project, as this one I'm working on uses some classes from those modules (ant magic).

Is there a way not to compile and make whole project, just single module? I'd like to be able to use it like in eclipse where you could always run your test even if the rest of your code was broken.

like image 906
grafthez Avatar asked Nov 13 '22 21:11

grafthez


1 Answers

For a Run configuration you can trigger any combination of

  • Make every thing
  • Build specific artefacts
  • Run ant targets
  • Run maven goals
  • Show settings.

Using a combination of these or turning them all off should allow you to run your program, building only what you need.

like image 146
Peter Lawrey Avatar answered Nov 15 '22 10:11

Peter Lawrey