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

Hi Igor,

> 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.

Adrian Rivard added:
> have the right version

All dependencies I'm talking about (in our case) have a pom.xml, and the
version contained in this pom.xml is the same as the version specified
in the <dependency> element. (In fact, all these versions are
'Main-SNAPSHOT' in my case.)

I can understand that you require the dependency to be a Maven project
and that the version is correct.

The problem is the requirement that the dependency has m2e nature declared
in its .project file.

The project hierarchy in my case is like this:

         A1    A2    A3    A4
          \     \    /     /
           \    |    |    /
            \    \  /    /
             \   |  |   /
              \   ||   /

                   B

                /  |   \
               /   |    \
              /    |     \
             /     |      \
            /      |       \
           /       |        \
          /        |         \
        C          D          E
       / \        / \        / \
      /   \      /   \      /   \
     C1   C2    D1   D2    E1   E2

All projects have a pom.xml, and we have a build system that publishes new
shapshots for all projects once a day.

The people working on A1, A2, A3, A4 would like to check out only their 
project
in their Eclipse workspace. They want to use B, C*, D*, E* as snapshots. 
For
them, m2e is useful.

The people working on C would like to check out all of C, C1, C2 into 
their
Eclipse workspace. For them, m2e is not useful: the download of new 
snapshots
every day is just a nuisance. Likewise for the people working on D and E.

But now, due to the reported problem between a project B that has m2e 
nature
and a project C that does not have m2e nature, we are being pushed to an
all-or-nothing decision: Use m2e for all projects, or don't use m2e at 
all.

> 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)

Thanks, I'll consider this solution.

> 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.

That's beyond me, sorry. I was hoping to see this functionality in m2e
itself.

Bruno



Back to the top