Maven Eclipse Plugin
  1. Maven Eclipse Plugin
  2. MECLIPSE-459

missing artifact references with pde mode enabled

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.5.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Maven version: 2.0.9
      Java version: 1.5.0_11
      OS name: "linux" version: "2.6.15-51-686" arch: "i386" Family: "unix"
    • Number of attachments :
      2

      Description

      Some artifacts are not referenced after executing mvn eclipse:eclipse and having pde mode enabled. The strange thing is, that this does only happen for particluar versions of an artifact.
      Two artifacts that I found with this problem are jetty (org.mortbay.jetty) and slf4j-log4j12 (org.slf4j-log4j12). Jetty versions beyond 6.1.5 work with pde enabled, higher versions do not. Same for slf4j-log4j12 versions =< 1.1.0.

      Attached is an example project demonstrating the problem. Turn pde mode on/off in the pom and execute mvn eclipse:eclipse.

        Activity

        Hide
        Simon Nickerson added a comment -

        I am working on the same project as Edd Steel (above) - we have pde mode enabled in the project which depends on commons-math. We have got round it by downgrading to 1.1. There appears to be a similar issue with commons-io.

        Show
        Simon Nickerson added a comment - I am working on the same project as Edd Steel (above) - we have pde mode enabled in the project which depends on commons-math. We have got round it by downgrading to 1.1. There appears to be a similar issue with commons-io.
        Hide
        luke w patterson added a comment -

        I see the same problem. When <pde> is enabled, some bundle dependencies are missing.

        Show
        luke w patterson added a comment - I see the same problem. When <pde> is enabled, some bundle dependencies are missing.
        Hide
        Eugene Voytitsky added a comment -

        Maybe plugin's author had reasons for implementing such a skipping
        but nowadays the more and more maven artifacts became osgi-fied,
        so skipping osgi-bundled artifact from being included in MANIFEST classpath (and skipping it beign linked to project as linkedResource)
        looks as unpractical.

        Currently there are at least 2 places in src where fixes should be applied:
        already mentioned EclipseClasspathWriter.java and also EclipseProjectWriter.java around the code:
        if ( dep.isAddedToClasspath() && !dep.isProvided() && !dep.isReferencedProject()
        && !dep.isTestDependency() && !dep.isOsgiBundle() )
        {

        Actually it would be great to have ability to specify whether include osgi bundles or not in plugin configuration options.
        Thanks.

        Show
        Eugene Voytitsky added a comment - Maybe plugin's author had reasons for implementing such a skipping but nowadays the more and more maven artifacts became osgi-fied, so skipping osgi-bundled artifact from being included in MANIFEST classpath (and skipping it beign linked to project as linkedResource) looks as unpractical. Currently there are at least 2 places in src where fixes should be applied: already mentioned EclipseClasspathWriter.java and also EclipseProjectWriter.java around the code: if ( dep.isAddedToClasspath() && !dep.isProvided() && !dep.isReferencedProject() && !dep.isTestDependency() && !dep.isOsgiBundle() ) { Actually it would be great to have ability to specify whether include osgi bundles or not in plugin configuration options. Thanks.
        Hide
        David Boden added a comment -

        Patch file that's working for me.

        Show
        David Boden added a comment - Patch file that's working for me.
        Hide
        Christian Gossart added a comment -

        Same problem here with slf4j-api-1.6.1 which is an OSGi bundle: dependency is not in provided scope, and PDE mode is enabled.
        I used the patch against the 2.9 tagged source of the plugin, and it worked as expected: the .project and the .classpath contain now the slf4j-api reference.
        Is there any hope to see this issue fixed in future release? Either not skipping the OSGi artefacts or a config option as proposed by Eugene.
        Maintaining a custom MEP will not be easy in my current project context.

        Show
        Christian Gossart added a comment - Same problem here with slf4j-api-1.6.1 which is an OSGi bundle: dependency is not in provided scope, and PDE mode is enabled. I used the patch against the 2.9 tagged source of the plugin, and it worked as expected: the .project and the .classpath contain now the slf4j-api reference. Is there any hope to see this issue fixed in future release? Either not skipping the OSGi artefacts or a config option as proposed by Eugene. Maintaining a custom MEP will not be easy in my current project context.

          People

          • Assignee:
            Unassigned
            Reporter:
            Benjamin Voigt
          • Votes:
            17 Vote for this issue
            Watchers:
            14 Start watching this issue

            Dates

            • Created:
              Updated: