-1

I have the following projects which are different projects (different root pom.xml):

  1. Infra Maven project
  2. Using Infra Maven project

When I change something in the infra, I have to mvn clean install in order to use the new code in project 2. As far as I have investigated (1 2 etc...) there is no other solution for that, or is there?

I'm using IntelliJ Ultimate.

Moshisho
  • 2,781
  • 1
  • 23
  • 39
  • I would suggest to combine them into a single multi module project and you can use `mvn clean package` ...apart from that in IDEA it should be handled correctly ...depending what you are doing in Eclipse the workspace resolution you don't need to do a `mvn install` before you can use the code... – khmarbaise Jul 11 '18 at 08:32
  • @khmarbaise Combining them into a single project is not an option... Thanks though. – Moshisho Jul 12 '18 at 05:44
  • @Downvoter, please explain your vote... – Moshisho Jul 12 '18 at 05:44

1 Answers1

1

You don't have to execute the goals clean install every time you changed something. You only have to use the "Tool Window" "Maven Projects". There you can use the + sign to import the dependency project in your current workspace in intellij. If you change something in project A, it will also be visible in project B without the need of using clean install and if project A is a dependency of project B.

Something that can occur is, make sure that the jar of project A is not already in the local mvn repository. That could cause conflicts.

The window "Maven Projects" can be found under View > Tool Windows > Maven Projects. I use Intellij Idea version 2018.1.3 and it works like a charm.

kedenk
  • 659
  • 6
  • 9
  • Did not think of that! thank you, it works, and as a bonus, while debugging I can enter the real implementation and not the bytecode ('Downloaded Sources' did not work). – Moshisho Jul 12 '18 at 05:52