zDev - M2E - OSS
  1. zDev - M2E - OSS
  2. MNGECLIPSE-1193

Scope provided not regarded building the classpath for test execution

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.9.6
    • Fix Version/s: None
    • Component/s: Dependency Resolver
    • Labels:
      None
    • Environment:
      Mac OS X 10.5.6, Eclipse 3.4, m2eclipse 0.9.7, too

      Description

      See the attached sample project. I have two web projects using the war overlay mechanism (runtime war dependency in extension). As I also need to reference types and files during compilation and test, I add a dependency to the classified jar, too. I declare it as provided to not include it twice in the jar. This creates a workspace dependency under "Maven dependencies". Trying to lookup the file from the Core project in the testcase fails unexpectedly. Running the test from the command line succeeds.

      Changing the scope to compile moves the workspace dependency to the "Web App Libraries" library makes the test pass again.

        Issue Links

          Activity

          Hide
          Eugene Kuleshov added a comment -

          Oliver, thanks for the test project, your scenario need to be investigated. Hoewever please note the following:

          • the "Maven Dependencies" container reflects test compile time scope, so it is supposed to have dependencies with scope "provided"
          • content of the "Maven Dependencies" container is not directly used to calculate runtime classpath for launching tests, there is different mechanism in place that uses Maven's dependency resolver
          Show
          Eugene Kuleshov added a comment - Oliver, thanks for the test project, your scenario need to be investigated. Hoewever please note the following: the "Maven Dependencies" container reflects test compile time scope, so it is supposed to have dependencies with scope "provided" content of the "Maven Dependencies" container is not directly used to calculate runtime classpath for launching tests, there is different mechanism in place that uses Maven's dependency resolver
          Hide
          Oliver Gierke added a comment -

          Thanks for your fast reply,

          doesn't that just boil down to a bug in resolving provided scope for workspace dependencies? As "normal" repository dependencies seem to be added to test runtime classpath in "provided" scope.

          Ollie

          Show
          Oliver Gierke added a comment - Thanks for your fast reply, doesn't that just boil down to a bug in resolving provided scope for workspace dependencies? As "normal" repository dependencies seem to be added to test runtime classpath in "provided" scope. Ollie
          Hide
          d.oosterveld added a comment - - edited

          Same here on a project.

          A core project has some classes, tests and harnasses defined.
          A second project uses the harnasses defined in the test packages.

          The test classes are packaged using attach-tests.
          This tests-jar is included in the second project in the test scope.

          The whole thing compiles:

          • on the command line
          • in eclipse with workspace dependency resolution turned off

          It does not compile if the workspace resolution is turned on.

          Same workaround as above: change the scope of the tests jars to 'provided'.

          This is not ideal because test scope workspace resolution would be a nice feature.

          Show
          d.oosterveld added a comment - - edited Same here on a project. A core project has some classes, tests and harnasses defined. A second project uses the harnasses defined in the test packages. The test classes are packaged using attach-tests. This tests-jar is included in the second project in the test scope. The whole thing compiles: on the command line in eclipse with workspace dependency resolution turned off It does not compile if the workspace resolution is turned on. Same workaround as above: change the scope of the tests jars to 'provided'. This is not ideal because test scope workspace resolution would be a nice feature.

            People

            • Assignee:
              Unassigned
              Reporter:
              Oliver Gierke
              Last Updated By:
              Brian Fox
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Date of First Response: