I would like to provide a simple URL that will always return the latest version of a snapshot version of an artifact. By simple I mean that the URL doesn't change, or require the user to browse the directory and examine timestamps.
相关问题
- Include pom.xml in Jar with gradle
- What order does maven find its dependencies?
- proguard causing EnumMap NPE on dynamically declar
- Maven: How to read the Parent POM version
- enableHiveSupport throws error in java spark code
相关文章
- IDEA2020 安装maven 插件后,springboot程序 SpringBootApplic
- pom文件中的插件定义
- pom.xml中的project为何报红
- Hibernate Tutorial - Where to put Mapping File?
- Cannot use org.jvnet.jax-ws-commons.jaxws-maven-pl
- Auto mirroring Nexus Proxy Repository
- New Maven install: mvn -version java.lang.ClassNot
- What's the difference between archetype.xml an
If you're looking for the latest version of a snapshot, just asking for say, "1.0-SNAPSHOT" will return the latest version of that artifact's snapshot.
If you're looking for "latest version" however, the "v=LATEST" syntax will work, but keep in mind that this keyword can return the latest version of that snapshot you're looking for, or the release that just completed, or that OTHER branch of that same artifact that is a version ahead and still at "-SNAPSHOT".
If you're looking for the absolute latest then yeah, use the "v=LATEST". If you're looking for the latest release, you can also ask for "v=RELEASE". If you have a grouping of repos, you can reference both snapshot repos and release repositories by adding to the url something like:
"...v=RELEASE&r=public"
That should search across all your "grouped" repos.
Every repository has its own url (you can see it in the Repository browser). If you open it, you can browse through the group and artifact ids to your artifact. That's your url, for example like this: http://nexushost.domain/content/repositories/snapshots/com/example/group/artifact/1.2.3-SNAPSHOT/1.2.3-SNAPSHOT.jar
The core Nexus "redirect" REST API can be used to retrieve any version of an artifact from a nominated repository:
For example:
https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=log4j&a=log4j&v=LATEST
The v parameter can be a value like 1.0-SNAPSHOT, in which case Maven will return the latest time-stamped snapshot held in the repository. Similiarily the special value "LATEST" should do the same provided a more recent released version is not present.
on my nexus machine all results for :
http://nexushost.domain/nexus/content/repositories/snapshots/com/company/elasticsearch-river-mongodb/1.2.3-SNAPSHOT/
are like this: *-1.2.3-20131204.143026-1.zip
so I can't access it directly because I need to provide more details that are dynamic.
The example with "...redirect?r=central-proxy&g=log4j&a=log4j&v=LATEST" is working if I open in browser but not when I what to install it from some linux machine using:
/usr/share/elasticsearch/bin/plugin --url "http://localhost:8081/nexus/service/local/artifact/maven/redirect?r=snapshots&g=com.comapny.application&a=elasticsearch-river-mongodb&v=1.2.3-SNAPSHOT&p=zip" --install river-mongodb
So my temporary solution is using wget :
wget -O /tmp/elasticsearch-river-mongodb.zip "http://nexushost.domain/nexus/service/local/artifact/maven/redirect?r=snapshots&g=com.comapny.application&a=elasticsearch-river-mongodb&v=1.2.3-SNAPSHOT&p=zip"
then install LATEST version from local file.