Sumedh
Sumedh

Reputation: 435

Intellij IDEA compiles all modules even though I asked for only 1

I have several modules in the project with a complex dependency structure. When I want to compile and run unit tests for 1 module, I want IDEA to ignore any compilation errors in unrelated modules. How can I do that? Currently IDEA compiles everything even if I say "compile module 1".

I don't want to setup several different projects for this.

Upvotes: 6

Views: 2879

Answers (2)

slim
slim

Reputation: 2583

Try checking your dependencies. I had this same issue because the Ivy plug-in had added what it thought was a needed lib which contained a class that would not compile due to a missing dependency. Once I removed it, the build ran fine.

Upvotes: 0

CrazyCoder
CrazyCoder

Reputation: 401965

In the test Run configuration specify the corresponding module. IntelliJ IDEA will compile only this module and required dependencies, it will not try to compile other modules if this test module doesn't depend on them.

If for some reason it doesn't work as expected, please try to share a small sample to illustrate the problem.

Upvotes: 3

Related Questions