Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Dependency scope and Eclipse classpath resolution

This is a limitation of JDT. Eclipse Java project will use single
classpath and single set of compiler preferences for all project
sources, which in m2e case means both main and test sources. Because of
this, m2e needs to use dependencies of all scopes (test scope includes
all other scopes) both for main and test sources and there is not way to
flag any classes as forbidden without triggering false-positive
in test sources.

There are two existing enhancement requests against JDT [1] and [2], but
I am not sure if they cover all aspects of main vs test dependencies in
Maven.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=224708
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=356450

--
Regards,
Igor

On 11-10-16 4:44 PM, Stanimir Stamenkov wrote:
Sun, 16 Oct 2011 23:25:16 +0300, /Stanimir Stamenkov/:

I've now realized if the above is possible, it could be used to
restrict the usage of "runtime" dependencies for compilation, also
(marking their APIs as forbidden, but still placing them on the
classpath for run configurations).

It appears at least possible to do define the access rules manually for
the "Maven Dependencies" container - it would be nice if this is done
automatically. Is anyone aware of a relevant Bugzilla entry for this or
I should file a new one?



Back to the top