Yoann Rodière created MDEP-556:
----------------------------------

             Summary: The dependency:resolve goal tries to resolve all 
dependencies, regardless of the exclude filters
                 Key: MDEP-556
                 URL: https://issues.apache.org/jira/browse/MDEP-556
             Project: Maven Dependency Plugin
          Issue Type: Bug
          Components: resolve
    Affects Versions: 3.0.0
            Reporter: Yoann Rodière


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:

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

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

But I get this stacktrace:

{noformat}
[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
{noformat}



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|https://github.com/apache/maven-plugins/blob/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependenciesMojo.java#L42].
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.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to