Maven Integration for Eclipse

J2EE Module Dependencies adds all scopes

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: dev
  • Fix Version/s: 0.9.4
  • Component/s: WTP integration
  • Labels:
    None
  • 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
  • Number of attachments :
    1

Description

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.

Issue Links

Activity

Hide
Eugene Kuleshov added a comment -

Please report this issue to WTP project. In my understanding they have designed their stuff to take over any scopes or deployment issues.

Show
Eugene Kuleshov added a comment - Please report this issue to WTP project. In my understanding they have designed their stuff to take over any scopes or deployment issues.
Hide
Marcel Schutte added a comment -

This issue contains a patch to solve the scope problem

Show
Marcel Schutte added a comment - This issue contains a patch to solve the scope problem
Hide
Gabriele Contini added a comment -

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.

Show
Gabriele Contini added a comment - 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.
Hide
Igor Fedorenko added a comment -

fixed. dependencies with provided/system/test scope are excluded from WTP export and publishing (they're still present in Maven Dependencies classpath container).

Show
Igor Fedorenko added a comment - fixed. dependencies with provided/system/test scope are excluded from WTP export and publishing (they're still present in Maven Dependencies classpath container).
Hide
Timo Meinen added a comment -

I still have this bug in Eclipse 3.4.1 Ganymede.

Show
Timo Meinen added a comment - I still have this bug in Eclipse 3.4.1 Ganymede.

People

Vote (7)
Watch (6)

Dates

  • Created:
    Updated:
    Resolved: