Original dependency file name after resolving it from remote repository

Hey,

i’m having a local ivy repository:

ivy {
     artifactPattern "/repository/nativeLibs/[classifier]/[artifact].[ext]"
}

Files are positioned like this:

/repository/nativeLibs/abc-2.0.1/artifact.something

with this i do the lookup"

'artifact::abc-2.0.1@so'

Reason for this rather unusual layout is that i don’t wanna change the name of the files. (The files are native libs like ‘lib snappy.so’ so that exists with multiple versions.

I’m using those resource definitions to put them into a folder of my project on demand. Doing like

configuration.resolvedConfiguration.resolvedArtifacts.each { ResolvedArtifact artifact ->
copy(artifact.file)

So this all works like a charm when using a local repository. However now i’m switching to s3. Everything works as before but the file names changed.
Instead of the original file name (how is it stored in the repo, which i wanna keep), i’m getting it like this

/Users/jz/.gradle/caches/modules-2/files-2.1/artifact/ac35e1138aac7212e6e7cea9919e0f2073d7526b/artifact--abc-2.0.1.so

Is there any way i can elegantly get or keep the original artefact name ?

best
Johannes