Question

I'm new to writing nexus plugins. From my plugin, I have a scheduled task. When the task is executed, I want to find all the artifacts in the configured repository that have an item with a certain maven classifier.

I'm injecting a RepositoryRegistry, getting a repository by id, and using List org.sonatype.nexus.proxy.repository.Repository.list(ResourceStoreRequest), but it only returns locally stored items. Is there a container managed component I could inject or a utility that will give me a List or Tree of items in the index?

I've looked at the lucene search api, but it requires a group, artifact, or version... I can't search by classifier. I've also looked at some of the sisu packages, but couldn't find anything.

For example Repository Proxy named MyRemote contains /my/group/artifactA/1/xml/features Repository Hosted named MyHosted contains /my/group/artifactB/1/xml/features Repository Group named MyGroup that contains MyRemote and MyHosted

I'm think I'm looking for a java API that will give me one of the following:

  • @Inject IndexManager??
  • List SomeUtil.searchRepo(..., String classifier, ...)
  • Tree SomeUtil.getIndexTree(String repoId)

and will list out both the my.group:artifactA:1:xml:features and my.group:artifactB:1:xml:features

Thanks!

Was it helpful?

Solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top