Uploaded image for project: 'Maven Enforcer Plugin'
  1. Maven Enforcer Plugin
  2. MENFORCER-393

Upgrading to 3.0.0 causes `Could not build dependency tree` with repositories some unknown protocol

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.4.0
    • None

    Description

      After upgrading to 3.0.0, it's not possible to validate the POM anymore, an error like 

      Could not build dependency tree Could not collect dependencies: {jarname}

      happens.

       

      I'm attaching the `mvn validate -X` dump (i have omitted some jars from the output) 

      Attachments

        1. enforcer_output
          124 kB
          johnny willer gasperi goncalves

        Issue Links

          Activity

            Can you verify if the wagon-s3 extension setup is correct?

             

            [DEBUG] Failure to find com.lastmile.finance:funding-instrument-ws:10.0.22-SNAPSHOT/maven-metadata.xml in https://nexus.atm.osp.tech/repository/maven-snapshot-group/ was cached in the local repository, resolution will not be reattempted until the update interval of atm-osp-payments-snapshot has elapsed or updates are forced
            [DEBUG] No transport java.util.NoSuchElementException
            {{ role: org.apache.maven.wagon.Wagon}}
            {{ roleHint: s3}}
            org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException
            {{ role: org.apache.maven.wagon.Wagon}}
            {{ roleHint: s3}}

             

            slachiewicz Sylwester Lachiewicz added a comment - Can you verify if the wagon-s3 extension setup is correct?   [DEBUG] Failure to find com.lastmile.finance:funding-instrument-ws:10.0.22-SNAPSHOT/maven-metadata.xml in https://nexus.atm.osp.tech/repository/maven-snapshot-group/ was cached in the local repository, resolution will not be reattempted until the update interval of atm-osp-payments-snapshot has elapsed or updates are forced [DEBUG] No transport java.util.NoSuchElementException {{ role: org.apache.maven.wagon.Wagon}} {{ roleHint: s3}} org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException {{ role: org.apache.maven.wagon.Wagon}} {{ roleHint: s3}}  

            Hi Sylwester, thank you very much to comment on this.

            We are not using wagon, but I see Maven Enforcer uses it, i didn't see on the usage page a need for configure wagon, is that necessary? can you give more info on how to setup that?

             

            When using Maven enforcer v1.4.1 this was not needed

            johnnywiller johnny willer gasperi goncalves added a comment - - edited Hi Sylwester, thank you very much to comment on this. We are not using wagon, but I see Maven Enforcer uses it, i didn't see on the usage page a need for configure wagon, is that necessary? can you give more info on how to setup that?   When using Maven enforcer v1.4.1 this was not needed
            olamy Olivier Lamy added a comment -

            johnnywiller any reproducer?

            by the way I can reproduce the same issue with this dependency:

            <dependency>
            <groupId>org.jruby</groupId>
            <artifactId>jruby-stdlib</artifactId>
            <version>9.2.13.0</version>
            </dependency>

             

            which have 

             
            <repositories>
            <repository>
            <id>mavengems</id>
            <url>mavengem:https://rubygems.org</url>
            </repository>
            </repositories>
             

            olamy Olivier Lamy added a comment - johnnywiller  any reproducer? by the way I can reproduce the same issue with this dependency: <dependency> <groupId>org.jruby</groupId> <artifactId>jruby-stdlib</artifactId> <version>9.2.13.0</version> </dependency>   which have    <repositories> <repository> <id>mavengems</id> <url>mavengem: https://rubygems.org </url> </repository> </repositories>  

            Hi olamy, sorry I don't have any reproducer, the library in case is private one. I'll do some tests, If I find one i share here. Thanks for looking at it 

            johnnywiller johnny willer gasperi goncalves added a comment - Hi olamy , sorry I don't have any reproducer, the library in case is private one. I'll do some tests, If I find one i share here. Thanks for looking at it 

            I have this message when upgrading to 3.0.0 from 3.0.0-M3

            [WARNING] Rule 5: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:
            Could not build dependency tree Could not collect dependencies: com.mac:mac-bc360-custom:jar:9.3.2-SNAPSHOT ()

            Dichotomia Quentin Caillard added a comment - I have this message when upgrading to 3.0.0 from 3.0.0-M3 [WARNING] Rule 5: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message: Could not build dependency tree Could not collect dependencies: com.mac:mac-bc360-custom:jar:9.3.2-SNAPSHOT ()
            marcospassos Marcos Passos added a comment -

            Exactly the same issue here.

            marcospassos Marcos Passos added a comment - Exactly the same issue here.
            tilman Tilman Hausherr added a comment - - edited

            Same problem in the Apache Tika project ( https://github.com/apache/tika/ ). I was trying to change version from 3.0.0-M3 to 3.0.0 in the parent pom.xml and one of the subprojects fails.

            Old output

            --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven-version) @ tika-parser-scientific-module ---
            
            --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-java-version) @ tika-parser-scientific-module ---
            
            --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-output-timestamp-property) @ tika-parser-scientific-module ---
            
            --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven) @ tika-parser-scientific-module ---
            
            --- maven-enforcer-plugin:3.0.0-M3:enforce (ban-bad-log4j-versions) @ tika-parser-scientific-module ---
            
            

            New output

            --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven-version) @ tika-parser-scientific-module ---
            
            --- maven-enforcer-plugin:3.0.0:enforce (enforce-java-version) @ tika-parser-scientific-module ---
            
            --- maven-enforcer-plugin:3.0.0:enforce (enforce-output-timestamp-property) @ tika-parser-scientific-module ---
            
            --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven) @ tika-parser-scientific-module ---
            Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
            Could not build dependency tree Could not collect dependencies: org.apache.tika:tika-parser-scientific-module:jar:2.2.2-SNAPSHOT ()
            
            tilman Tilman Hausherr added a comment - - edited Same problem in the Apache Tika project ( https://github.com/apache/tika/ ). I was trying to change version from 3.0.0-M3 to 3.0.0 in the parent pom.xml and one of the subprojects fails. Old output --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven-version) @ tika-parser-scientific-module --- --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-java-version) @ tika-parser-scientific-module --- --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-output-timestamp-property) @ tika-parser-scientific-module --- --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven) @ tika-parser-scientific-module --- --- maven-enforcer-plugin:3.0.0-M3:enforce (ban-bad-log4j-versions) @ tika-parser-scientific-module --- New output --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven-version) @ tika-parser-scientific-module --- --- maven-enforcer-plugin:3.0.0:enforce (enforce-java-version) @ tika-parser-scientific-module --- --- maven-enforcer-plugin:3.0.0:enforce (enforce-output-timestamp-property) @ tika-parser-scientific-module --- --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven) @ tika-parser-scientific-module --- Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message: Could not build dependency tree Could not collect dependencies: org.apache.tika:tika-parser-scientific-module:jar:2.2.2-SNAPSHOT ()

            Maybe related: before the above comment, I had to change two entries in another subproject due to convergence problems, like this because osgi 6 was used elsewhere, and log4j has a weak dependency on an earlier version of osgi:

                <dependency>
                  <groupId>org.apache.logging.log4j</groupId>
                  <artifactId>log4j-core</artifactId>
                  <version>${log4j2.version}</version>
                  <scope>test</scope>
                  <exclusions>
                      <!-- depends on org.osgi.core 4.3.1 -->
                      <exclusion>
                          <groupId>org.osgi</groupId>
                          <artifactId>org.osgi.core</artifactId>
                      </exclusion>
                  </exclusions>
                </dependency>
            
            tilman Tilman Hausherr added a comment - Maybe related: before the above comment, I had to change two entries in another subproject due to convergence problems, like this because osgi 6 was used elsewhere, and log4j has a weak dependency on an earlier version of osgi: <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>${log4j2.version}</version> <scope>test</scope> <exclusions> <!-- depends on org.osgi.core 4.3.1 --> <exclusion> <groupId>org.osgi</groupId> <artifactId>org.osgi.core</artifactId> </exclusion> </exclusions> </dependency>

            Still happens with 3.1.0.

            tilman Tilman Hausherr added a comment - Still happens with 3.1.0.
            famod Falko Modler added a comment - - edited

            Same here with enforcer 3.1.0 and Maven 3.8.6:

            [ERROR] Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
            Could not build dependency tree Could not collect dependencies: io.quarkus:quarkus-extension-processor:jar:999-SNAPSHOT
            

            -X reveals:

            ...
            Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact rubygems:rubygems-update:pom:3.2.29 from/to mavengems (mavengem:https://rubygems.org): Cannot access mavengem:https://rubygems.org with type default using the available connector factories: BasicRepositoryConnectorFactory
            ...
            Caused by: org.eclipse.aether.transfer.NoTransporterException: Unsupported transport protocol mavengem:https
            ...
            Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException
                  role: org.apache.maven.wagon.Wagon
              roleHint: mavengem
            Caused by: java.util.NoSuchElementException
                at org.eclipse.sisu.plexus.RealmFilteredBeans$FilteredItr.next (RealmFilteredBeans.java:118)
                at org.eclipse.sisu.plexus.RealmFilteredBeans$FilteredItr.next (RealmFilteredBeans.java:1)
                at org.eclipse.sisu.plexus.DefaultPlexusBeans$Itr.next (DefaultPlexusBeans.java:76)
                at org.eclipse.sisu.plexus.DefaultPlexusBeans$Itr.next (DefaultPlexusBeans.java:1)
                at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
                at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255)
                at org.eclipse.aether.internal.transport.wagon.PlexusWagonProvider.lookup (PlexusWagonProvider.java:56)
                ...
            

            Ruby comes in via: https://github.com/quarkusio/quarkus/blob/main/core/processor/pom.xml#L42-L46

            famod Falko Modler added a comment - - edited Same here with enforcer 3.1.0 and Maven 3.8.6: [ERROR] Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message: Could not build dependency tree Could not collect dependencies: io.quarkus:quarkus-extension-processor:jar:999-SNAPSHOT -X reveals: ... Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact rubygems:rubygems-update:pom:3.2.29 from/to mavengems (mavengem:https://rubygems.org): Cannot access mavengem:https://rubygems.org with type default using the available connector factories: BasicRepositoryConnectorFactory ... Caused by: org.eclipse.aether.transfer.NoTransporterException: Unsupported transport protocol mavengem:https ... Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException role: org.apache.maven.wagon.Wagon roleHint: mavengem Caused by: java.util.NoSuchElementException at org.eclipse.sisu.plexus.RealmFilteredBeans$FilteredItr.next (RealmFilteredBeans.java:118) at org.eclipse.sisu.plexus.RealmFilteredBeans$FilteredItr.next (RealmFilteredBeans.java:1) at org.eclipse.sisu.plexus.DefaultPlexusBeans$Itr.next (DefaultPlexusBeans.java:76) at org.eclipse.sisu.plexus.DefaultPlexusBeans$Itr.next (DefaultPlexusBeans.java:1) at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263) at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255) at org.eclipse.aether.internal.transport.wagon.PlexusWagonProvider.lookup (PlexusWagonProvider.java:56) ... Ruby comes in via: https://github.com/quarkusio/quarkus/blob/main/core/processor/pom.xml#L42-L46
            githubbot ASF GitHub Bot added a comment -

            slawekjaranowski opened a new pull request, #271:
            URL: https://github.com/apache/maven-enforcer/pull/271

            Following this checklist to help us incorporate your
            contribution quickly and easily:

            • [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MENFORCER) filed
              for the change (usually before you start working on it). Trivial changes like typos do not
              require a JIRA issue. Your pull request should address just this issue, without
              pulling in other changes.
            • [x] Each commit in the pull request should have a meaningful subject line and body.
            • [x] Format the pull request title like `[MENFORCER-XXX] - Fixes bug in ApproximateQuantiles`,
              where you replace `MENFORCER-XXX` with the appropriate JIRA issue. Best practice
              is to use the JIRA issue title in the pull request title and in the first line of the
              commit message.
            • [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
            • [x] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
              be performed on your pull request automatically.
            • [x] You have run the integration tests successfully (`mvn -Prun-its clean verify`).

            If your pull request is about ~20 lines of code you don't need to sign an
            [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
            please ask on the developers list.

            To make clear that you license your contribution under
            the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
            you have to acknowledge this by using the following check-box.

            githubbot ASF GitHub Bot added a comment - slawekjaranowski opened a new pull request, #271: URL: https://github.com/apache/maven-enforcer/pull/271 Following this checklist to help us incorporate your contribution quickly and easily: [x] Make sure there is a [JIRA issue] ( https://issues.apache.org/jira/browse/MENFORCER ) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. [x] Each commit in the pull request should have a meaningful subject line and body. [x] Format the pull request title like ` [MENFORCER-XXX] - Fixes bug in ApproximateQuantiles`, where you replace `MENFORCER-XXX` with the appropriate JIRA issue. Best practice is to use the JIRA issue title in the pull request title and in the first line of the commit message. [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. [x] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. [x] You have run the integration tests successfully (`mvn -Prun-its clean verify`). If your pull request is about ~20 lines of code you don't need to sign an [Individual Contributor License Agreement] ( https://www.apache.org/licenses/icla.pdf ) if you are unsure please ask on the developers list. To make clear that you license your contribution under the [Apache License Version 2.0, January 2004] ( http://www.apache.org/licenses/LICENSE-2.0 ) you have to acknowledge this by using the following check-box. [x] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004] ( http://www.apache.org/licenses/LICENSE-2.0 ) [x] In any other case, please file an [Apache Individual Contributor License Agreement] ( https://www.apache.org/licenses/icla.pdf ).

            I added org.jruby:jruby-stdlib to IT - and looks like test pass.

            Please retest with 3.3.0 version

            sjaranowski Slawomir Jaranowski added a comment - I added org.jruby:jruby-stdlib  to IT - and looks like test pass. Please retest with 3.3.0 version

            The problem I mentioned in January 2022 no longer happens with 3.3.0.

            tilman Tilman Hausherr added a comment - The problem I mentioned in January 2022 no longer happens with 3.3.0.
            githubbot ASF GitHub Bot added a comment -

            slawekjaranowski merged PR #271:
            URL: https://github.com/apache/maven-enforcer/pull/271

            githubbot ASF GitHub Bot added a comment - slawekjaranowski merged PR #271: URL: https://github.com/apache/maven-enforcer/pull/271

            fixed in 3.3.0 - now I added IT for regressions, so reports in 3.3.1

            sjaranowski Slawomir Jaranowski added a comment - fixed in 3.3.0 - now I added IT for regressions, so reports in 3.3.1

            People

              sjaranowski Slawomir Jaranowski
              johnnywiller johnny willer gasperi goncalves
              Votes:
              3 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: