Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij: Making a project dependent on another project?

I am new to using Intellij and I am facing a problem. I have a project, which is dependent on another project and this second project is integrated using maven repository. So when I work on my project, maven handles everything perfectly and everything is working. But the second project is under development and there are frequent updates which are not in maven repository yet. So what I want to do is to make my first project directly dependent on the second project(it is present in my local system). So that the second project is referred directly from the code and not maven repo. Is it possible in Intellij. I have done this in Eclipse but not able to do it in Intellij. Any help will be usesful.

Thanks

like image 633
Raman Avatar asked Aug 05 '15 13:08

Raman


People also ask

How do I add a project as a dependency of another project?

Right-click the utility project, and select Maven>Add Dependency. Type a dependency name in the Enter groupID… field (e.g., commons-logging) to search for a dependency. Select the dependency, and click OK.

How do I change dependencies in IntelliJ?

From the main menu, select File | Project Structure Ctrl+Alt+Shift+S , and go to Modules | Dependencies. In the next dialog, click Edit, and then click Configure next to the Include transitive dependencies option. Select the dependencies you want to include in the library and click OK.

How do I change the dependency of a project in IntelliJ?

This information is valid for projects that are built with the native IntelliJ IDEA builder. If you're using a build tool, such as Maven or Gradle, make all changes using the build file. From the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Modules | Dependencies.

How do I add a dependency to a project?

From the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Modules | Dependencies. Click Alt+Insert and select a dependency type:

How to add a dependency to an IJ module?

On the Dependencies tab, there is no add button. On the Dependencies tab, there is no add button. There will be one if you resize the dialog. "Develop with Pleasure!" Eclipse project ~= IJ module (check this page for the terminology). So, you need to define one module as dependency for another one.

Why is the Order of dependencies important in IntelliJ?

Sort dependencies The order of dependencies is important as IntelliJ IDEA will process them in the same order as they are specified in the list. During compilation, the order of dependencies defines the order in which the compiler (javac) looks for classes to resolve the corresponding references.


1 Answers

You should be able to configure this in IntelliJ IDEA's Project properties (cmd + ; on Mac, ctrl + alt + shift + s on Windows/Linux). Select "Modules", select the dependencies tab on the right, and add the dependent module to the module.

like image 186
Trisha Avatar answered Oct 01 '22 16:10

Trisha