jprete
jprete

Reputation: 3759

Inter-module class usage for a Maven project in Eclipse

We're using Maven for a large project that is broken up into eight or so modules. The structure of Maven projects in Eclipse makes it difficult to understand class usage between modules - if module 1 defines class Widget, and module 2 uses it, then you can't just look for references to class Widget, because from the Eclipse perspective the Widget in module 1 is different than the Widget used by module 2.

Is there a good solution to this, other than "don't use Maven" or "use the global Java search"?

Upvotes: 1

Views: 788

Answers (2)

jprete
jprete

Reputation: 3759

m2eclipse has an option in the Maven project context menu called "Enable Workspace Resolution" which controls whether the Maven artifacts or the workspace projects are used to resolve intra-project dependencies. Turning this on set Eclipse to look for the workspace version of the class and solved my problem.

Upvotes: 1

gabuzo
gabuzo

Reputation: 7768

I daily work in Eclipse on a large project split into several maven artifacts using Eclipse. I use the m2eclipse and I have no issue to navigate from a module to another. Eclipse is even able to use a opened projects as an artifact rather than fetching it from the repository.

The only restriction I saw is that you should have a one artifact to one Eclipse project mapping and it works flawlessly.

Upvotes: 0

Related Questions