Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-18873

Missing client dependency in user BOM

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 31.0.0.Final
    • 31.0.0.Beta1
    • BOM
    • None

      The org.wildfly.bom:wildfly-ee-with-tools:31.0.0.Beta1 includes a dependency for the Apache HTTP Client. However, the Apache HTTP Client in the generated BOM has an exclusion on commons-logging:commons-logging. The problem is the Apache HTTP Client is required by the RESTEasy Client. Attempting to use this outside the container will result in a java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory error.

      The issue seems to be the wildfly-bom-builder-plugin for the org.wildfly.bom:wildfly-ee BOM is set to <inheritExclusions>UNMANAGED</inheritExclusions>. Because WildFly the server does not use commons-logging:commons-logging, the dependency is excluded in an import POM on the builder causing the it to be excluded in the generated BOM.

      I've filed an issue against the wildfly-bom-builder-plugin to come up with a solution for this. I've submitted PR's for two options:

      1. https://github.com/wildfly/wildfly-bom-builder-plugin/pull/24
      2. https://github.com/wildfly/wildfly-bom-builder-plugin/pull/25

      The first allows the inheritExclusions to be set on the included dependencies. The second one is more global and allows a list of ignored exclusions. When found in that list, the exclusion is not added to any dependency in the BOM.

      In either case the generated BOM looks correct. The exclusions are not there on the dependencies. However, the BOM still doesn't seem to transitvely bringing in the commons-logging dependency for some reason.

      jperkins@stalefish ~/projects/wildfly/quickstarts/microprofile-rest-client (main *) $ mvn dependency:tree
      [INFO] Scanning for projects...
      [INFO] 
      [INFO] ----------< org.wildfly.quickstarts:microprofile-rest-client >----------
      [INFO] Building Quickstart: microprofile-rest-client 31.0.0.Beta1-SNAPSHOT
      [INFO]   from pom.xml
      [INFO] --------------------------------[ war ]---------------------------------
      [INFO] 
      [INFO] --- dependency:3.6.0:tree (default-cli) @ microprofile-rest-client ---
      [INFO] org.wildfly.quickstarts:microprofile-rest-client:war:31.0.0.Beta1-SNAPSHOT
      [INFO] +- jakarta.enterprise:jakarta.enterprise.cdi-api:jar:4.0.1:provided
      [INFO] |  +- jakarta.enterprise:jakarta.enterprise.lang-model:jar:4.0.1:provided
      [INFO] |  +- jakarta.annotation:jakarta.annotation-api:jar:2.1.1:provided
      [INFO] |  +- jakarta.interceptor:jakarta.interceptor-api:jar:2.1.0:provided
      [INFO] |  \- jakarta.inject:jakarta.inject-api:jar:2.0.1:provided
      [INFO] +- jakarta.ws.rs:jakarta.ws.rs-api:jar:3.1.0:provided
      [INFO] +- jakarta.json:jakarta.json-api:jar:2.1.3:provided
      [INFO] +- org.junit.jupiter:junit-jupiter:jar:5.10.1:test
      [INFO] |  +- org.junit.jupiter:junit-jupiter-api:jar:5.10.1:test
      [INFO] |  |  +- org.opentest4j:opentest4j:jar:1.3.0:test
      [INFO] |  |  +- org.junit.platform:junit-platform-commons:jar:1.10.1:test
      [INFO] |  |  \- org.apiguardian:apiguardian-api:jar:1.1.2:test
      [INFO] |  +- org.junit.jupiter:junit-jupiter-params:jar:5.10.1:test
      [INFO] |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.10.1:test
      [INFO] |     \- org.junit.platform:junit-platform-engine:jar:1.10.1:test
      [INFO] +- org.eclipse.microprofile.rest.client:microprofile-rest-client-api:jar:3.0.1:test
      [INFO] +- org.eclipse.microprofile.config:microprofile-config-api:jar:3.1:test
      [INFO] +- org.jboss.resteasy:resteasy-client:jar:6.2.6.Final:test
      [INFO] |  +- org.jboss.resteasy:resteasy-client-api:jar:6.2.6.Final:test
      [INFO] |  +- org.jboss.resteasy:resteasy-core-spi:jar:6.2.6.Final:test
      [INFO] |  |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:4.0.1:test
      [INFO] |  |  \- jakarta.validation:jakarta.validation-api:jar:3.0.2:test
      [INFO] |  +- org.jboss.resteasy:resteasy-core:jar:6.2.6.Final:test
      [INFO] |  |  +- jakarta.activation:jakarta.activation-api:jar:2.1.2:test
      [INFO] |  |  +- org.eclipse.angus:angus-activation:jar:2.0.1:test
      [INFO] |  |  \- com.ibm.async:asyncutil:jar:0.1.0:test
      [INFO] |  +- org.jboss.logging:jboss-logging:jar:3.5.3.Final:test
      [INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.14:test
      [INFO] |  |  \- org.apache.httpcomponents:httpcore:jar:4.4.16:test
      [INFO] |  +- commons-codec:commons-codec:jar:1.15:test
      [INFO] |  \- org.reactivestreams:reactive-streams:jar:1.0.4:test
      [INFO] +- org.jboss.resteasy:resteasy-json-binding-provider:jar:6.2.6.Final:test
      [INFO] |  +- jakarta.json.bind:jakarta.json.bind-api:jar:3.0.0:test
      [INFO] |  \- org.eclipse:yasson:jar:3.0.2:test
      [INFO] +- org.jboss.resteasy:resteasy-json-p-provider:jar:6.2.6.Final:test
      [INFO] +- org.eclipse.parsson:parsson:jar:1.1.5:test
      [INFO] +- org.jboss.resteasy:resteasy-undertow-cdi:jar:6.2.6.Final:test
      [INFO] |  +- io.undertow:undertow-servlet:jar:2.3.10.Final:test
      [INFO] |  |  \- jakarta.servlet:jakarta.servlet-api:jar:6.0.0:test
      [INFO] |  +- io.undertow:undertow-core:jar:2.3.10.Final:test
      [INFO] |  |  +- org.jboss.xnio:xnio-api:jar:3.8.8.Final:test
      [INFO] |  |  |  +- org.wildfly.common:wildfly-common:jar:1.7.0.Final:test
      [INFO] |  |  |  \- org.wildfly.client:wildfly-client-config:jar:1.0.1.Final:test
      [INFO] |  |  +- org.jboss.xnio:xnio-nio:jar:3.8.8.Final:test
      [INFO] |  |  \- org.jboss.threads:jboss-threads:jar:2.4.0.Final:test
      [INFO] |  +- org.jboss.resteasy:resteasy-cdi:jar:6.2.6.Final:test
      [INFO] |  +- org.jboss.weld:weld-core-impl:jar:5.1.1.SP2:test
      [INFO] |  |  +- org.jboss.weld:weld-spi:jar:5.0.SP3:test
      [INFO] |  |  +- org.jboss.classfilewriter:jboss-classfilewriter:jar:1.3.0.Final:test
      [INFO] |  |  \- jakarta.el:jakarta.el-api:jar:5.0.1:test
      [INFO] |  +- org.jboss.weld:weld-api:jar:5.0.SP2:test
      [INFO] |  +- org.jboss.weld.se:weld-se-core:jar:5.1.1.SP2:test
      [INFO] |  |  +- org.jboss.weld.environment:weld-environment-common:jar:5.1.1.SP2:test
      [INFO] |  |  \- org.jboss.weld:weld-lite-extension-translator:jar:5.1.1.SP2:test
      [INFO] |  |     \- org.jboss.logging:jboss-logging-processor:jar:2.2.1.Final:provided
      [INFO] |  |        +- org.jboss.logging:jboss-logging-annotations:jar:2.2.1.Final:provided
      [INFO] |  |        \- org.jboss.jdeparser:jdeparser:jar:2.0.3.Final:provided
      [INFO] |  \- org.jboss.weld.servlet:weld-servlet-core:jar:5.1.1.SP2:test
      [INFO] |     \- org.jboss.weld.module:weld-web:jar:5.1.1.SP2:test
      [INFO] +- io.smallrye:jandex:jar:3.1.6:test
      [INFO] +- io.smallrye.config:smallrye-config:jar:3.4.3:test
      [INFO] |  \- io.smallrye.config:smallrye-config-core:jar:3.4.4:test
      [INFO] |     +- io.smallrye.common:smallrye-common-annotation:jar:2.2.0:test
      [INFO] |     +- io.smallrye.common:smallrye-common-expression:jar:2.2.0:test
      [INFO] |     |  \- io.smallrye.common:smallrye-common-function:jar:2.2.0:test
      [INFO] |     +- io.smallrye.common:smallrye-common-constraint:jar:2.2.0:test
      [INFO] |     +- io.smallrye.common:smallrye-common-classloader:jar:2.2.0:test
      [INFO] |     +- org.ow2.asm:asm:jar:9.5:test
      [INFO] |     \- io.smallrye.config:smallrye-config-common:jar:3.4.4:test
      [INFO] \- org.jboss.resteasy.microprofile:microprofile-rest-client:jar:2.1.4.Final:test
      [INFO]    \- org.jboss.resteasy.microprofile:microprofile-rest-client-base:jar:2.1.4.Final:test
      

      The important part is really:

      [INFO] +- org.jboss.resteasy:resteasy-client:jar:6.2.6.Final:test
      [INFO] |  +- org.jboss.resteasy:resteasy-client-api:jar:6.2.6.Final:test
      [INFO] |  +- org.jboss.resteasy:resteasy-core-spi:jar:6.2.6.Final:test
      [INFO] |  |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:4.0.1:test
      [INFO] |  |  \- jakarta.validation:jakarta.validation-api:jar:3.0.2:test
      [INFO] |  +- org.jboss.resteasy:resteasy-core:jar:6.2.6.Final:test
      [INFO] |  |  +- jakarta.activation:jakarta.activation-api:jar:2.1.2:test
      [INFO] |  |  +- org.eclipse.angus:angus-activation:jar:2.0.1:test
      [INFO] |  |  \- com.ibm.async:asyncutil:jar:0.1.0:test
      [INFO] |  +- org.jboss.logging:jboss-logging:jar:3.5.3.Final:test
      [INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.14:test
      [INFO] |  |  \- org.apache.httpcomponents:httpcore:jar:4.4.16:test
      [INFO] |  +- commons-codec:commons-codec:jar:1.15:test
      [INFO] |  \- org.reactivestreams:reactive-streams:jar:1.0.4:test
      

      When looking at the dependency tree on the org.jboss.resteasy:resteasy-client it looks correct:

      [INFO] --- dependency:3.6.0:tree (default-cli) @ resteasy-client ---
      [INFO] org.jboss.resteasy:resteasy-client:jar:6.2.6.Final
      [INFO] +- org.jboss.resteasy:resteasy-client-api:jar:6.2.6.Final:compile
      [INFO] +- org.jboss.resteasy:resteasy-core-spi:jar:6.2.6.Final:compile
      [INFO] |  +- jakarta.annotation:jakarta.annotation-api:jar:2.1.1:compile
      [INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:3.0.1:compile
      [INFO] |  \- jakarta.validation:jakarta.validation-api:jar:3.0.2:compile
      [INFO] +- org.jboss.resteasy:resteasy-core:jar:6.2.6.Final:compile
      [INFO] |  +- org.jboss:jandex:jar:2.4.4.Final:compile
      [INFO] |  +- jakarta.activation:jakarta.activation-api:jar:2.1.2:compile
      [INFO] |  +- org.eclipse.angus:angus-activation:jar:1.0.0:compile
      [INFO] |  \- com.ibm.async:asyncutil:jar:0.1.0:compile
      [INFO] +- org.jboss.logging:jboss-logging:jar:3.5.3.Final:compile
      [INFO] +- org.jboss.logging:jboss-logging-annotations:jar:2.2.1.Final:provided
      [INFO] +- org.jboss.logging:jboss-logging-processor:jar:2.2.1.Final:provided
      [INFO] |  \- org.jboss.jdeparser:jdeparser:jar:2.0.3.Final:provided
      [INFO] +- org.apache.httpcomponents:httpclient:jar:4.5.14:compile
      [INFO] |  +- org.apache.httpcomponents:httpcore:jar:4.4.16:compile
      [INFO] |  \- commons-logging:commons-logging:jar:1.2:compile
      [INFO] +- commons-codec:commons-codec:jar:1.15:compile
      [INFO] +- org.apache.httpcomponents:httpasyncclient:jar:4.1.5:compile
      [INFO] |  \- org.apache.httpcomponents:httpcore-nio:jar:4.4.15:compile
      [INFO] +- org.eclipse.jetty:jetty-client:jar:11.0.18:compile
      [INFO] |  +- org.eclipse.jetty:jetty-http:jar:11.0.18:compile
      [INFO] |  |  \- org.eclipse.jetty:jetty-util:jar:11.0.18:compile
      [INFO] |  +- org.eclipse.jetty:jetty-io:jar:11.0.18:compile
      [INFO] |  +- org.eclipse.jetty:jetty-alpn-client:jar:11.0.18:compile
      [INFO] |  \- org.slf4j:slf4j-api:jar:2.0.5:compile
      [INFO] +- jakarta.ws.rs:jakarta.ws.rs-api:jar:3.1.0:compile
      [INFO] +- org.reactivestreams:reactive-streams:jar:1.0.4:compile
      [INFO] \- junit:junit:jar:4.13.2:test
      [INFO]    \- org.hamcrest:hamcrest-core:jar:1.3:test
      

      I've attached two path files for WildFly for each approach. I tend to prefer the second approach.

        1. ignore-exclusions.patch
          4 kB
          James Perkins
        2. inherit-exclusions.patch
          4 kB
          James Perkins

              emartins@redhat.com Eduardo Martins
              jperkins-rhn James Perkins
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: