Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] dependencies to projects in the workspace

m2e populates "Maven Dependencies" container based on Maven dependency
information provided by project pom.xml file. It is not possible to
match pom.xml <dependency> elements to non-Maven workspace projects in a
generic way, so the behaviour you see is expected and not a bug.

Having said that, there are couple of ways you can make m2e do what you
want.

It is possible to manually add classpath entries to Maven projects using
JDT standard "Java Build Path" project properties page. m2e will
preserve such entries during project configuration update and you can
even check in .classpath files to git (or whatever scm you use) so all
members of your team will use the same classpath.

It is also possible to implement m2e project configurator that will
create additional classpath entries automatically. If you want to try
this, I can provide some pointers on m2e-dev list.

--
Regards,
Igor

On 2014-03-29, 7:31, Bruno Haible wrote:
Hi,

With m2e 1.4.0.20130601 I observe that the "Maven Dependencies" container
of a
Java project with m2e nature will contain
   * references to artifacts for
     - projects that are not loaded in the workspace,
     - projects that are loaded in the workspace and don't have m2e nature,
     - third-party libraries.
   * references to workspace projects for
     - projects that are loaded in the workspace and have m2e nature.

The developer experience in Eclipse is much better when using references
to
workspace projects than with artifacts:
   - After navigating to a class, the developer can directly edit its
source code.
     Whereas an artifact's source code cannot be edited.
   - When debugging, it provides a great productivity boost to be able to
edit
     the source code on the fly, save it, and continue with the same
debugging
     session.
   - When not debugging, changes to the other project's source code are
taken
     into account directly by Eclipse, when no artifacts are used. Whereas
with
     artifacts, the developer needs to launch a Maven build and then a
Refresh
     on the project that uses the artifact.

What I would like to have is that the "Maven Dependencies" container
contains
   * references to artifacts for
     - projects that are not loaded in the workspace,
     - third-party libraries.
   * references to workspace projects for
     - projects that are loaded in the workspace and have m2e nature,
     - projects that are loaded in the workspace and don't have m2e nature,

Is there a way to configure m2e to this effect?

If not, is it a bug or a design choice?

Best regards,
----------------------------------------------------------------------------
Bruno Haible                            Email: <bruno.haible@xxxxxxxxxx>
IBM Deutschland
Wilhelm-Fay-Straße 30-34
65936 Frankfurt am Main
Germany
----------------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294



Back to the top