VHristov
VHristov

Reputation: 1089

Make Eclipse reference maven projects and not jars

I'm trying to have the projects within my workspace to reference each other directly, instead of the jar files from the maven repo. That used to work perfectly fine when having all the projects in the same folder (eclipse workspace) and using mvn install and mvn eclipse:eclipse. However, now it's not working and I believe it's due to the fact that the projects are not located in the workspace folder, but in my local GIT repo, from where I import them into Eclipse. I assume that I need to set some variable somewhere, but couldn't find anything on this on the interwebs. I've also tried using the eclipse maven plugin, but I got into other problems that completely broke my setup. Using -Declipse.useProjectReferences=true doesn't help either. I'm grateful for any hint!

Upvotes: 1

Views: 1334

Answers (2)

Paul Cuddihy
Paul Cuddihy

Reputation: 567

I suddenly began having this problem after a reboot (??).

What worked for me was:

  • on my project's context menu, open "Properties"
  • Java Build Path tab: add the projects which need to be referenced
  • Order and Export tab: move these projects to the top of the list

Upvotes: 2

E-Riz
E-Riz

Reputation: 32914

There's a setting on each Project to control this behavior. Right-click to open the project Properties, then select the Maven section; there you'll find the option Resolve dependencies from Workspace projects.

enter image description here

Upvotes: 1

Related Questions