Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368645 - Scoped Dependency Containers in Eclipse
Summary: Scoped Dependency Containers in Eclipse
Status: CLOSED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-16 03:04 EST by Christoph Grotz CLA
Modified: 2021-04-19 13:27 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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/