How search RemoteRepositories with Aether in Java?

How can I search a specific artifact in Aether?

Dependency dependency =
    new Dependency( new DefaultArtifact( "" ), "compile" );
RemoteRepository central = new RemoteRepository.Builder( "central", "default", "" ).build();

CollectRequest collectRequest = new CollectRequest();
collectRequest.setRoot( dependency );
collectRequest.addRepository( central );
DependencyNode node = repoSystem.collectDependencies( session, collectRequest ).getRoot();

DependencyRequest dependencyRequest = new DependencyRequest();
dependencyRequest.setRoot( node );

repoSystem.resolveDependencies( session, dependencyRequest  );

PreorderNodeListGenerator nlg = new PreorderNodeListGenerator();
node.accept( nlg );
System.out.println( nlg.getClassPath() );

At first, I want to search all "gson" in RemoteRepository and get result with all information then download it. But how? In this example, I must set correct one and download it.


You can't search for artifacts by name with Aether or Maven.

If you want a search engine, try There's also a REST API.

Need Your Help

Python : Another Name Error

python nameerror

I have two sets of code that essentially have the same goal but neither work and come up with the same name error. I'm trying to make it so they only letters are accept as answers, not numbers. Whe...

How to execute PHP and SQL sessions inside Ajax?

php ajax

I've been asking similar questions here today, but I'm seeing I think the issue is with how I am calling my data?