I’m thinking about storing large file in Nexus3 as well (RAW repository would be the repo), which would allow me to upload the same file under different names but keeping disk usage low as the binary store deduplicates. Currently I do this via SSH and hardlinks on a file server. Now while I can easily do that via raw repositories I would also like to avoid uploading the same 5 gigabytes multiple times - instead I just want to create a hardlink or a deduplicated “COPY” of it. In the documentation the DAV protocol is used which uses the HTTP methods “COPY” and “MOVE” for stuff like this, but if you call the repo endpoint with COPY I get an internal server error (code 500). (Log message: java.lang.RuntimeException: Unsupported action: COPY)
Has anyone done anything like this? Would this be a welcomed addition to the raw repositories (aka feature request)?
In the documentation the DAV protocol is used which uses the HTTP methods “COPY” and “MOVE” for stuff like this, but if you call the repo endpoint with COPY I get an internal server error (code 500)
Nexus Repository does not implement DAV protocol.
Would this be a welcomed addition to the raw repositories (aka feature request)?
Yes, absolutely! Please feel free to send feature request either to here on the Community Forum or directly to our Issue Tracker. However, in the case of this particular feature request we already have an improvement ticket ready: NEXUS-12084. Please vote for the ticket, so we can track how popular it is to help with our roadmap planing.
Yeah, I thought so, but as it was mentioned in the docs I thought maybe I’d give it a try
Will do, but while that’s useful it’s not what I asked in the first place. I wanted to create a duplicate / identical file in a different path without the need to upload it first. So I’d need some kind of API (either like in the DAV protocol by adding some more HTTP verbs I can use or some other kind of REST API I could use to create anoter path to the same file).
Anyway, will vote on NEXUS-12084 and create a new one for the other. [UPDATE]: Created issue NEXUS-28574
If anyone has another idea, please let me know. Maybe some Groovy scripting could be it? Though I have no idea where to start…
Realistically I think you need to write your own Nexus plugin.
It may be theoretically possible to hack something in using a ContributedHandler, but that won’t allow you to add routes for HTTP verbs.
Most likely you would need to write your own format, this probably makes the most sense as you could avoid storing the same asset twice with custom code if you wanted.
I found that it’s possible to trigger groovy scripts from the REST API including parameters. Haven’t tinkered yet with the API, but hopefully I should be able to retrieve an asset and store it under a different path without the need to reuploading it.
Still then the blobstore dedupe would be required in order to preserve disk space.
So I guess for now I will just use what we had before - plain NGINX served directory and SSH for uploading and symlinking where needed.