Intellij - Add project dependency like in Eclipse

2019-01-19 13:06发布

问题:

I'm switching to Intellij and trying to do the same thing as in Eclipse. In Eclipse, you can add a project as a dependency in another project (project properties -> "Java Build Path" -> "Projects" -> Click on my library project).

The current situation is that I'm developing a library and I can test the features in another project without building the jar file every time I add new stuff to the library.

I'm trying to achieve this with Intellij but without success (the projects are both imported in Intellij).

How can I do that?

回答1:

File > Project Structure. Then choose your module, and add any dependency, either Jar, Library or Module:

Larger image here: http://i.imgur.com/rjdxJHx.png



回答2:

From File -> project structure, select Modules. You will be presented with all the added projects. Click a project and from the right hand side select Dependencies tab. This will show you projects that are not imported in red coloured text. HTH