No need to manually parse maven-metadata.xml. No need to manually parse directory names or file names.
http://localhost/nexus/service/local/lucene/search?g=com.foo&a=foo-bar
returns for each <artifactHit> all other elements that uniquely identify everything that can be downloaded from this Nexus URL, namely: <repositoryId> and <extension> (and <classifier> are undefined here):
... <artifact> <groupId>com.foo</groupId> <artifactId>foo-bar</artifactId> <version>2.8.1</version> <latestSnapshot>2.8.5-SNAPSHOT</latestSnapshot> <latestSnapshotRepositoryId>snapshots</latestSnapshotRepositoryId> <latestRelease>2.8.3</latestRelease> <latestReleaseRepositoryId>releases</latestReleaseRepositoryId> <artifactHits> <artifactHit> <repositoryId>releases</repositoryId> <artifactLinks> <artifactLink> <extension>pom</extension> </artifactLink> <artifactLink> <extension>war</extension> </artifactLink> </artifactLinks> </artifactHit> </artifactHits> </artifact> <artifact> <groupId>com.foo</groupId> <artifactId>foo-bar</artifactId> <version>2.8.0</version> <latestSnapshot>2.8.5-SNAPSHOT</latestSnapshot> <latestSnapshotRepositoryId>snapshots</latestSnapshotRepositoryId> <latestRelease>2.8.3</latestRelease> <latestReleaseRepositoryId>releases</latestReleaseRepositoryId> <artifactHits> <artifactHit> <repositoryId>releases</repositoryId> <artifactLinks> <artifactLink> <extension>pom</extension> </artifactLink> <artifactLink> <extension>war</extension> </artifactLink> </artifactLinks> </artifactHit> </artifactHits> </artifact>
So, after you analyze the lucene / search answer yourself, you can filter it using repositoryId. This answer is for Nexus 2.11.
source share