dreadiscool
dreadiscool

Reputation: 1598

Intellij set module compile output as library

I was wondering if this was possible in IntelliJ

I have 3 modules (Client, Server, and Protocol). My current way of doing things is to compile the Protocol module as a jar, and then use it as a library in my Client & Server module. However, this means that I have to refresh IntelliJ each time.

Is there a way for me to add a module as a library directly to my Server and Client modules? I have already tried going into libraries and adding the src/ folder for Protocol to my Client and Server modules.

I also looked at http://www.jetbrains.com/idea/webhelp/configuring-module-dependencies-and-libraries.html but couldn't get an answer.

Thanks in advance!

Upvotes: 0

Views: 114

Answers (1)

Java Devil
Java Devil

Reputation: 10959

Have you tried this:

  • Project Structure Ctrl+Alt+Shift+S (for Windows) or File - Project Structure
  • Modules (on LHS)
  • You should now see 3 modules in the middle list (provided you have set up the modules)
  • Select the module to add a dependency to
  • Dependencies Tab (Top Middle)
  • Click + symbol on RHS to add a dependency
  • Select Module Dependency
  • Choose the module which it depends on.

This requires that all 3 modules are set up within the same project.

Upvotes: 2

Related Questions