Uploaded image for project: 'Nuxeo ECM Build/Test Environment'
  1. Nuxeo ECM Build/Test Environment
  2. NXBT-944

Fix transitive dependencies scope filtering

    XMLWordPrintable

    Details

    • Sprint:
      DevOps Sprint 10

      Description

      During the graph generation, there are unexpected nodes (resolved children) which should have been filtered out following the Maven rules on transitive dependencies scope: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Transitive_Dependencies

      [WARNING] Unexpected child node: hsqldb:hsqldb:jar:1.8.0.1 (test) for org.nuxeo.ecm.platform:nuxeo-platform-test:jar:5.9.1 (test)
      [WARNING] Unexpected child node: org.nuxeo.runtime:nuxeo-runtime-scripting:jar:5.9.1 (test) for org.nuxeo.ecm.platform:nuxeo-platform-test:jar:5.9.1 (test)
      [WARNING] Unexpected child node: org.nuxeo.runtime:nuxeo-runtime-test:jar:5.9.1 (test) for org.nuxeo.ecm.platform:nuxeo-platform-test:jar:5.9.1 (test)
      [WARNING] Unexpected child node: org.nuxeo.ecm.core:nuxeo-core-test:jar:5.9.1 (test) for org.nuxeo.ecm.platform:nuxeo-platform-test:jar:5.9.1 (test)
      [WARNING] Unexpected child node: org.nuxeo.runtime:nuxeo-runtime-launcher:jar:5.9.1 (test) for org.nuxeo.ecm.platform:nuxeo-platform-test:jar:5.9.1 (test)
      target/it/test3/build.log:[WARNING] Unexpected child node: junit:junit:jar:4.8.1 (test) for org.nuxeo.ecm.platform:nuxeo-platform-test:jar:5.9.1 (test)

      That is due to Aether implementation which builds a full graph with "no assumption on any relationships between the scopes". Even our own org.nuxeo.build.maven.graph.ScopeDependencySelector.ScopeDependencySelector(String...) is not enough to prevent unwanted dependencies being collected before their scope is managed regarding their parent scope.
      Current implementation is filtering out the dependency nodes if:

      • parent scope is test, child scope is provided or test,
      • parent scope is not test and child scope is test.
        Since the Aether upgrade, it seems enough to simply filter out non-root nodes which scope is test or provided.

      In the mean time, the logged message level can be decreased to DEBUG.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: