[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [m2e-users] Code completion only for direct dependencies
- From: Igor Fedorenko <igor@xxxxxxxxxxxxxx>
- Date: Mon, 12 Mar 2012 19:56:44 -0400
- Delivered-to: email@example.com
- User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
Maven does not distinguish between direct and indirect dependencies.
Changing this inside m2e will almost certainly break many existing
projects and will introduce unnecessary confusion to the users. It may
also result in unwanted/unexpected interference with maven
"nearest-first" dependency conflict resolution approach, but I can be
wrong here (have not really thought about it, to be honest). I do not
believe this is a good change for m2e.
At the same time, m2e APIs allow customization of Maven Dependencies
classpath, including classpath visibility rules, so you should be able
to implement behaviour you describe in a standalone (eclipse) plugin,
without making changes to m2e.
On 12-03-12 7:45 AM, Stefan Rademacher wrote:
I know the dependency:analyze goal, which does exactly, what I'd like to
be integrated into m2e: Recognize dependencies, which aren't declared
Igor, which other metadata do you think is needed? Wouldn't it be
sufficient to check, if a dependency is declared directly in the
In a non-maven project, .classpath would look like this:
<classpathentry kind="lib" path="libs/somelib.jar"
<accessrule kind="nonaccessible" pattern="**"/>
Is it possible to define such "nonaccessible" rule for liraries within
>>> <m2e-users-request@xxxxxxxxxxx> 09.03.2012 18:00 >>>
Date: Thu, 08 Mar 2012 18:40:10 -0500
From: Igor Fedorenko <igor@xxxxxxxxxxxxxx>
To: Maven Integration for Eclipse users mailing list
Subject: Re: [m2e-users] Code completion only for direct dependencies
Content-Type: text/plain; charset=UTF-8
There is no notion of classpath access rules in Maven, so m2e simply
does not have the metadata needed. Until this is supported in maven
core, there is not much we can do in m2e.
Sent from my SGS
Stefan Rademacher <Rademacher@xxxxxxx> wrote:
>we are currently moving our complete build management from Ant to
>Maven. One advantage now is the strong dependency management,
>especially for transitive dependencies.
>But within eclipse, there is a big downside, that we didn't see before:
>The code completion allows every developer to use classes from any
>transitive dependency, even though it isn't explicitly declared in our
>An example: An open source library uses Google Guava internally, but we
>- for some reason - don't want to use it in our code. The "Maven
>Dependencies" in Eclipse contain Google Guava, because it is needed by
>that 3rd party library, and is consequently also offered in the Eclipse
>Is there a way to tell m2e to restrict the access only to the direct
>dependencies, declared in our pom.xml? Maybe by generating Eclipse
>access rules for the "Maven Dependencies" Classpath Container?
>Thank you very much and best regards
>m2e-users mailing list
m2e-users mailing list