Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-602

NoSuchMethodException using DependencyCollector with Maven 3.0

    XMLWordPrintableJSON

Details

    Description

      The component Maven30DependencyCollector, which is used internally by DependencyCollector when running with Maven 3.0.x, raises a NoSuchMethodException when called. The stacktrace is:

      Caused by: org.apache.maven.shared.dependencies.collect.DependencyCollectorException: org.apache.maven.RepositoryUtils.toDependency(org.sonatype.aether.graph.Dependency, org.sonatype.aether.artifact.ArtifactTypeRegistry)
      	at org.apache.maven.shared.dependencies.collect.internal.Invoker.invoke(Invoker.java:133)
      	at org.apache.maven.shared.dependencies.collect.internal.Maven30DependencyCollector.toDependency(Maven30DependencyCollector.java:166)
      	at org.apache.maven.shared.dependencies.collect.internal.Maven30DependencyCollector.collectDependencies(Maven30DependencyCollector.java:116)
      	at org.apache.maven.shared.dependencies.collect.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:93)
      	at org.apache.maven.plugins.dependency.resolvers.ListRepositoriesMojo.doExecute(ListRepositoriesMojo.java:62)
      	... 22 more
      Caused by: java.lang.NoSuchMethodException: org.apache.maven.RepositoryUtils.toDependency(org.sonatype.aether.graph.Dependency, org.sonatype.aether.artifact.ArtifactTypeRegistry)
      	at java.lang.Class.getMethod(Class.java:1786)
      	at org.apache.maven.shared.dependencies.collect.internal.Invoker.invoke(Invoker.java:121)
      	... 26 more
      

      In the method toDependency, it tries to reflectively calls the method RepositoryUtils#toDependency. In Maven 3.0.x, this method takes as parameter objects of type org.apache.maven.model.Dependency and org.sonatype.aether.artifact.ArtifactTypeRegistry. However, the code tries to look for a method taking as first parameter an object of type org.sonatype.aether.graph.Dependency instead. Since this method doesn't exist, the exception is thrown.

      Attachments

        Activity

          People

            gboue Guillaume Boué
            gboue Guillaume Boué
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: