![]() ![]() If you have a grouping of repos, you can reference both snapshot repos and release repositories by adding to the url something like: '. ![]() If you're looking for the latest release, you can also ask for 'vRELEASE'. To install this script, just run the following : curl -v -X POST -u : -header "Content-Type:application/json" -d can then test it easily with : curl -v -X POST -u : -header "Content-Type: text/plain" " -d "com.my. Nexus is based on Java so you will need to install Java version 8 in your system. If you're looking for the absolute latest then yeah, use the 'vLATEST'. the version Maven used to use (with the -SNAPSHOT suffix). You can then use it to get the baseVersion i.e. This class provides extra information about its container with the function attributes(). The interesting part here is the tx.findComponents() that returns generic Component class. StorageFacet storageFacet = repo.facet(StorageFacet) ĭef tx = storageFacet.txSupplier().get() ĭef components = tx.findComponents(Query.builder().where('group = ').param(groupId).build(), ) ĭef baseVersion = it.attributes().child('maven2').get('baseVersion') Next time you download the same dependency, it will be cached in your Nexus. Import .storage.StorageFacet ĭef repo = (repositoryId) A repository that proxies everything you download from the official npm registry. Here's an example of a script I used to write to return all versions for a given group and repository. if you run Rebuild Metadata for the Nexus repository. If right now it returns you the correct version of the artifact, tomorrow this may stop working e.g. Nexus simply doesn't guarantee the LATEST to work in other cases. Using the new REST API on Nexus v3 (exact version 3.17.0) the following request to retrieve the latest snapshot worked for me: /service/rest/v1/search/assets/downloadsortversion&maven.artifactIdartifactId&. ![]() You can create a script in Groovy and upload it to Nexus to do what you want. In Nexus LATEST is designed to work with maven plugins rather than with regular artifacts.
0 Comments
Leave a Reply. |