Issue Details (XML | Word | Printable)

Key: MNGECLIPSE-347
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Igor Fedorenko
Reporter: Court Zabel
Votes: 7
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
Maven Integration for Eclipse

J2EE Module Dependencies adds all scopes

Created: 10/Jun/07 11:29 PM   Updated: 02/May/08 10:48 PM
Component/s: WTP integration
Affects Version/s: dev
Fix Version/s: 0.9.4

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive M2EclipseJ2EEDependencyTest.zip (4 kB)

Environment:
Eclipse 3.3.0 Build id: I20070601-1539
J2EE Standard Tools (JST) v2.0.0-200703280045
Web Standard Tools (WST) v2.0.0-20070509
Issue Links:
Related
 


 Description  « Hide
When "Maven 2 Dependencies" is "checked" as a JAR/Module Dependency under Project->J2EE Module Dependencies, all dependency scopes are deployed when Dynamic Web Project is deployed to a server via the Web Standard Tools plugin. This can cause problems when dependencies with the "provided" scope are deployed into the app server.

The attached eclipse project has 3 dependencies:
commons-lang-2.2 in default scope
jsp-api-2.1 in provided scope
junit-4.1 in test scope

When this is deployed to Tomcat all three JARs end up in the lib director in org.eclipse.wst.server.core\tmp1\webapps\M2EclipseTest\WEB-INF\lib.

I'd expect this particular part of the plugin to deploy only dependencies in the compile scope.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Eugene Kuleshov added a comment - 10/Jun/07 11:47 PM
Please report this issue to WTP project. In my understanding they have designed their stuff to take over any scopes or deployment issues.

Marcel Schutte added a comment - 28/Aug/07 07:37 AM
This issue contains a patch to solve the scope problem

Gabriele Contini added a comment - 06/Sep/07 01:48 PM
In my opinion dependencies with scope provided shouldn't even be inserted into "Maven 2 dependencies".
They're usually dependent on development environment, and they can change for instance when a developer change application server for compatibility tests.
Eclipse has already classpath variables that reflect the deployment environment.
For instance the above dependency jsp-api-2.1.jar with provided scope could be easily replaced by Eclipse variable Properties->Java build path->Libraries->Add Library->Server Runtime.

Igor Fedorenko added a comment - 02/May/08 10:48 PM
fixed. dependencies with provided/system/test scope are excluded from WTP export and publishing (they're still present in Maven Dependencies classpath container).