How to construct depencies for pdf files with no Maven conform filenames

I have revised my enquiry again to show only the open question.

I have an Artifactory repository in which, in addition to other Maven-compliant deployed jar files, there are also PDF files that have not been loaded into the Artifactory in a Maven-compliant manner.

Example: For a fictitious module xxx, I have the following files in my artifactory location:
myRepository/at/mic/xxx/at.mic.xxx.doc/8.1.0/:
MIC-XXX_User_Guide_de.pdf
MIC-XXX_User_Guide_en.pdf
Although the file names of the two PDF files are different, they have the same Maven coordinates: group: ‘at.mic.xxx’, name: ‘at.mic.xxx.doc’, version: ‘8.1.0’, ext: ‘.pdf’

I have tried this dependency definition for this purpose:

repositories {
  ivy {
    url <https://"myRepository">
    patternLayout {
      artifact "[organisation]/[module]/[revision]/[artifact].[ext]"
      m2compatible = true
  }
  metadataSources {
    artifact()
  }
}
dependencies {
  implementation(group: "at.mic.xxx", name: "at.mic.xxx.doc", version: "8.1.0", changing: true) {
    artifact {
      name = 'MIC-XXX_User_Guide_de' 
      extension = 'pdf'
    }
  }
}

Unfortunately, this dependency definition gives me this error:

> Could not find MIC-XXX_User_Guide_de-8.1.0.pdf (at.mic.xxx:at.mic.xxx.doc:8.1.0).
     Searched in the following locations:
         myRepository/at/mic/xxx/at.mic.xxx.doc/8.1.0/MIC-XXX_User_Guide_de-8.1.0.pdf

When resolving the dependencies, Gradle expects my PDF files to contain the version at the end of the file name (typical for Maven).
Do you have any advice on what I need to change so that Gradle tries to download MIC-XXX_User_Guide_de.pdf instead of MIC-XXX_User_Guide_de-8.1.0.pdf?

thanks in advance!
Frank

This is what I get from your snippet, so it seems to work as expected:

     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/at/mic/xxx/at.mic.xxx.doc/8.1.0/MIC-XXX_User_Guide_de.pdf

Maybe you did not save the file or something like that?

Thanks for the tip. This is different from what I have observed. I’ll have to investigate this further.

1 Like