Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368645

Summary: Scoped Dependency Containers in Eclipse
Product: z_Archived Reporter: Christoph Grotz <grotz>
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: fbricon, grotz, igor
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Christoph Grotz CLA 2012-01-16 03:04:06 EST
Hi,

I'm sure the problem is common. When using m2e with a wtp project, you don't
want to deploy every jar included in the "maven dependency container". For example the Junit.jar and the servlet-api.jar shouldn't be deployed. The idee would be to create extra classpath containers for every scope.

The following blog entry descripse it very nicley:
http://www.mhaller.de/archives/146-M2Eclipse-and-Web-Tools.html
Comment 1 Fred Bricon CLA 2012-01-16 03:49:49 EST
Christoph, if you're using m2e with wtp projects, you should install m2e-wtp (https://github.com/sonatype/m2eclipse-wtp/wiki), it adds extra configuration to the Maven Classpath container so that test and provided dependencies are not deployed to WTP servers.

While having separate scoped Classpath Libraries might seem a good idea on paper, it would also bring discrepancies between Maven and Eclipse's classpath behavior, as classpath order would be changed : You'd get all test dependencies first, then compile, then provided (well, in the order in which these libraries are added to the classpath), which would not reflect and potentially break Maven's natural classpath order.
Comment 2 Igor Fedorenko CLA 2012-01-16 05:50:36 EST
As explained in comment #1, separate classpath container per dependency scope will result in wrong compile classpath order.
Comment 3 Denis Roy CLA 2021-04-19 13:27:11 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/