Hi, I am try to use Maven-Indexer to search artifacts from Nexus3. But I get some problems.
I cannot get path or remoteUrl of ArtifactInfo, It always be null.
My code refers to maven-indexer/BasicUsageExample.java at master · apache/maven-indexer · GitHub.
public void listJenkinsPlugins() throws IOException {
// Case:
// Use index
// Searching for some artifact
Query hpiQ =
indexer.constructQuery(MAVEN.PACKAGING, new SourcedSearchExpression("hpi"));
BooleanQuery bq = new BooleanQuery();
bq.add( hpiQ, Occur.MUST );
System.out.println( "Searching for jenkins plugins " );
FlatSearchResponse response = indexer.searchFlat(new FlatSearchRequest(hpiQ, centralContext));
for (ArtifactInfo ai : response.getResults()) {
// it always be null
System.out.println(ai.getPath()+ ": " + ai.toString());
System.out.println(ai.getRemoteUrl()+ ": " + ai.toString());
}
}
Any help will be appreciated.