Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ Community with 2 maven projects in same window

I have a maven project project-a and project-b wo depends on project-a.

How can I work with this 2 projects in same IntelliJ window?

I want to be able to make changes on project-a and reflect them to project-b without deploy/install the project-a. I already do this on Eclipse using m2e plugin.

EDITIED

After setting the Build, Execution, Deployment | Build Tools | Maven | Importing >> Import Maven projects automatically the IDE was able to build part of my projects.

Now I'm facing another problem. This project-a has a dependency tohibernate-entitymanager who has a dependency to hibernate-core who has a dependency tohibernate-jpa-2.1-api.

My project uses some classes from this hibernate-jpa-2.1-api jar, but seems that the IntelliJ can not resolve sub-dependencies, forcing me to redeclare this dependency (hibernate-jpa-2.1-api) on theproject-a / pom.xml. Is this the expected behavior?

like image 499
Beto Neto Avatar asked Nov 15 '25 10:11

Beto Neto


1 Answers

You should add you maven projects as modules to Intellij IDEA as already said CrazyCoder.

And then do 'Add As Maven Project' by right click on the every module's pom.xml in the Project tab. This way you will be able to use cross-module searches, refactorings etc. Compilation will also be performed against the added Maven Projects without a need to install artifacts into the repository.

like image 183
Mike Adamenko Avatar answered Nov 17 '25 08:11

Mike Adamenko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!