A: 

in IntelliJ,you can select the module and right click it,and set the properties(include dependencies) for the selected module.

liya
+3  A: 

Managing the dependencies yourself can quickly get complicated for non-trivial applications. For dependency management in Java, I suggest looking at Maven. Using the "test" scope you can bundle the project without all of the testing code. IntelliJ, like other populate IDEs, has built-in support for Maven.

Maven - Introduction to the Dependency Mechanism

Hope it helps!

Neal Swearer