Question

I'm new to IntelliJ Idea and have question connected to module dependencies. Is it possible to add into module dependencies a global library but in the form of source files that I can edit and compile together with dependent module?

The problem I'm trying to solve is as follows:

  1. I have universal library module A - under development.
  2. I have universal library module B - under development and dependent on A.
  3. I have application project dependent on both: A and B.

I would like to develop those three components in convenient way in one IntelliJ Idea window, but I don't want to include libraries A and B directly as project modules because they are generic and will be used by other projects in the future. How to properly solve puzzle like this?

The only idea I have is to use file system hack and add those libraries as modules but with directory links directing to their original location.

Was it helpful?

Solution 2

You should definitely configure these libraries as modules and use a dependency on another module in your main application module.

If you are going to use them in other projects in the future, you can add the same library modules to the other projects. Another option would be to configure an Artifact that will produce the jar file for the libraries that you can then use in your other projects.

OTHER TIPS

The only idea I have is to use file system hack and add those libraries as modules but with directory links directing to their original location.

Please don't do that. (IDEA is NOT eclipse)

IDEA can work with modules located anywhere on your drives and create a single IDEA project with all those modules (use File>Import module... to add a new module to your current window).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top