Uploaded image for project: 'Maven Dependency Plugin'
  1. Maven Dependency Plugin
  2. MDEP-556

The dependency:resolve goal tries to resolve all dependencies, regardless of the exclude filters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0
    • None
    • resolve
    • None

    Description

      My use case was to download dependencies in a CI script, before executing the build. To that end, I wanted to execute something along the lines of:

      mvn -q -B dependency:resolve -DexcludeArtifactIds='hibernate-search-integrationtest-wildfly'
      

      ... hibernate-search-integrationtest-wildfly being a module that other modules in my project depend on.

      But I get this stacktrace:

      [ERROR] Failed to execute goal on project hibernate-search-performance: Could not resolve dependencies for project org.hibernate:hibernate-search-performance:jar:5.8.0-SNAPSHOT: Cannot access jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public-jboss/) in offline mode and the artifact org.hibernate:hibernate-search-integrationtest-wildfly:jar:tests:5.8.0-SNAPSHOT has not been downloaded from it before. -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project hibernate-search-performance: Could not resolve dependencies for project org.hibernate:hibernate-search-performance:jar:5.8.0-SNAPSHOT: Cannot access jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public-jboss/) in offline mode and the artifact org.hibernate:hibernate-search-integrationtest-wildfly:jar:tests:5.8.0-SNAPSHOT has not been downloaded from it before.
      	at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:221)
      	at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:245)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:199)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project org.hibernate:hibernate-search-performance:jar:5.8.0-SNAPSHOT: Cannot access jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public-jboss/) in offline mode and the artifact org.hibernate:hibernate-search-integrationtest-wildfly:jar:tests:5.8.0-SNAPSHOT has not been downloaded from it before.
      	at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:211)
      	at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195)
      	... 23 more
      Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Cannot access jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public-jboss/) in offline mode and the artifact org.hibernate:hibernate-search-integrationtest-wildfly:jar:tests:5.8.0-SNAPSHOT has not been downloaded from it before.
      	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:384)
      	at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:205)
      	... 24 more
      Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Cannot access jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public-jboss/) in offline mode and the artifact org.hibernate:hibernate-search-integrationtest-wildfly:jar:tests:5.8.0-SNAPSHOT has not been downloaded from it before.
      	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
      	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
      	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:367)
      	... 25 more
      Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Cannot access jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public-jboss/) in offline mode and the artifact org.hibernate:hibernate-search-integrationtest-wildfly:jar:tests:5.8.0-SNAPSHOT has not been downloaded from it before.
      	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:391)
      	... 27 more
      Caused by: org.eclipse.aether.transfer.RepositoryOfflineException: Cannot access jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public-jboss/) in offline mode
      	at org.eclipse.aether.internal.impl.DefaultOfflineController.checkOffline(DefaultOfflineController.java:72)
      	at org.eclipse.aether.internal.impl.Utils.checkOffline(Utils.java:115)
      	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:387)
      	... 27 more
      

      I think I know why this fails: when one executes the dependency:resolve goal, there is a first dependency resolution requested by the mojo executor, because the resolve mojo is marked as requiring resolution of test-scoped dependencies.
      I am not sure why the dependency:resolve mojo would require this, though... It seems odd, considering that the purpose of this mojo is to perform dependency resolution.

      Attachments

        Activity

          People

            Unassigned Unassigned
            yrodiere Yoann Rodière
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: