ServiceMix
  1. ServiceMix
  2. SM-2045

jbi-maven-plugin should not filter out optional dependencies

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 4.0, jbi-maven-plugin-4.5
    • Fix Version/s: jbi-maven-plugin-4.6
    • Component/s: tooling
    • Labels:
      None

      Description

      jbi-maven-plugin should not filter out optional dependencies of the project(pom.xml) that it's executed on. The optional element in maven denotes whether the dependency should be taken transitively for the dependent projects -it is not supposed to have effect on project that defines the dependency as optional.

      So I think "!artifact.isOptional()" should be removed from:
      http://svn.apache.org/viewvc/servicemix/maven-plugins/jbi-maven-plugin/trunk/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyMojo.java?view=markup
      --------
      if (!artifact.isOptional() && filter.include(artifact) && (artifact.getDependencyTrail().size() == 2)) {
      ---------
      Also, the same might concern the component/su generation mojos...

      The use case and problem I ran into:
      I'm supposed to package an SA to an rpm from a different maven project(via the basic maven way: a dependency). It's really not necessary for those SA dependencies to be propagated transitively to the rpm project. Of course I tried the basic maven way and added the optional flag to the dependencies in the SA project. To my surprise, the SA was empty when I built it. Yes, there are workarounds, but still this a bug in jbi-maven-plugin.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Kari J. Niemi
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development