Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] Resolving test dependencies using aether

Arthur Kalmenson wrote:

Yes, that's what we did, we set a custom DependencySelector and now
it's transitively pulling down the test dependencies of each
dependency. That's actually not the behavior we want

Frankly, I don't quite understand this statement. If your custom DependencySelector does not what you want, then implement it the way you want it. [0] gives some background on the graph processing.

The behavior that we're looking to
mimic with aether is really:

mvn dependency:copy-dependencies

As an alternative to the custom DependencySelector, you can replace the current call to collectRequest.setRoot() with an equivalent of the below call

   collectRequest.setDependencies(
       system.readArtifactDescriptor( session,
           new ArtifactDescriptorRequest( artifact,
              Arrays.asList( repo ), null ) ).getDependencies() );

This basically mimics the way Maven resolves project dependencies.

Aether stores files in the local repository. So once resolved, you have to copy them to the desired location yourself.


Benjamin


[0] https://docs.sonatype.org/display/AETHER/Introduction


Back to the top