Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5501

Pom dependency are not reduced when embedding is inline

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • maven-bundle-plugin-3.2.0
    • None
    • Maven Bundle Plugin
    • None
    • Maven 3.3.9
      Windows OS

    Description

      Looking the code (DependencyEmbedder#processDependencies) seems that pom reduction is not performed when embedding is marked as inline.

      Let me explain with use cases.

      Use case 1 (inline)
      I would embed a third party (for example commons-io) dependency inline into my project P1 means that all commons-io classes are placed into the P1.jar.
      Classes are visible throught export package manifest header in a OSGi environment and to the compiler at compile time (javac).

      When I build with maven a project P2 that has P1 as dependency, maven lookup also P1 dependencies, so in the classpath I have (P1 + commons-io) classes from P1 jar and commons-io classes again from commons-io jar. Duplicate classes in classpath.

      I think that this is the use case that more benefits from pom reduction.

      Use case 2 (not inline)
      I would embed a third party (for example commons-lang) dependency into my project P1 as jar in a lib/ folder that means commons-lang.jar is placed as nested jar of the P1.jar and it is added to Bundle-Classpath manifest header.
      Classes are visible throught export package manifest header in a OSGi environment but NO to the compiler at compile time (javac) because it's a jar into jar.

      When I build with maven a project P2 that has P1 as dependency, maven looks also for P1 dependencies (empty because stripped by reduction), so I have in the classpath only P1 classes from P1 jar and no commons-lang classes so build fails.

      So I think that this is the use case that have should no benefit of pom reduction.

      Seems the actual behaviour is reversed or at least should be performed also in inline use case

      Attachments

        1. FELIX-5501.patch
          13 kB
          Nikolas Falco

        Activity

          People

            Unassigned Unassigned
            nfalco79 Nikolas Falco
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: