1

I am using the following snippet (from the aether examples) to resolve maven dependencies using Aether. BUt it fails for the snapshot dependencies. Is there a way I can set up the configuration to include the snapshot dependencies as well?

 public static void main( String[] args )
    throws Exception
{
    System.out.println( "------------------------------------------------------------" );
    System.out.println( GetDirectDependencies.class.getSimpleName() );

    RepositorySystem system = Booter.newRepositorySystem();

    RepositorySystemSession session = Booter.newRepositorySystemSession( system );

    Artifact artifact = new DefaultArtifact( "org.eclipse.aether:aether-impl:1.0.0.v20140518" );

    ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
    descriptorRequest.setArtifact( artifact );
    descriptorRequest.setRepositories( Booter.newRepositories( system, session ) );

    ArtifactDescriptorResult descriptorResult = system.readArtifactDescriptor( session, descriptorRequest );

    for ( Dependency dependency : descriptorResult.getDependencies() )
    {
        System.out.println( dependency );
    }
}
user_mda
  • 18,148
  • 27
  • 82
  • 145
  • Use the answer from http://stackoverflow.com/questions/35488167/how-can-you-find-the-latest-version-of-a-maven-artifact-from-java-using-aether – MariuszS Apr 18 '16 at 19:22

0 Answers0