Multiple repositories in Gradle 4.3

Hi,

we have a build with multiple repositories:

  1. Nexus for manage public dependencies(cache proxy)
  2. Flat repository in the file system.
    The second one we use for artifacts which should be stored locally. With Gradle 4.3 we got this. Have someone any ideas how this behavior might be disabled or avoided?

Can you please be more specific what problem you are facing? Gradle will only fail if a repository had an error (e.g. 503, 401 etc.). If the response is 404 (not found), Gradle will continue as usual. Is your Nexus repository returning an error code like “unauthorized”?

Yes, we got a “400” code

 > Could not resolve :Wowza Media Server 3.6.2/lib/jid3lib-0.5.4:.
   Required by:
       project :WowzaModules_3_x
    > Could not resolve :Wowza Media Server 3.6.2/lib/jid3lib-0.5.4:.
       > Could not get resource 'http://artifact-repo:38081/repository/external-proxy//Wowza%20Media%20Server%203.6.2/lib/jid3lib-0.5.4//Wowza%20Media%20Server%203.6.2/lib/jid3lib-0.5.4-.pom'.
        > Could not GET 'http://artifact-repo:38081/repository/externals//Wowza%20Media%20Server%203.6.2/lib/jid3lib-0.5.4//Wowza%20Media%20Server%203.6.2/lib/jid3lib-0.5.4-.pom'. 
        Received status code 400 from server: Invalid repository path

Thank you for the details. We are reverting this change for 4.3.1 and making the handling more lenient in 4.4. See https://github.com/gradle/gradle/issues/3335

1 Like

The exception you are getting looks like a bad dependency declaration though. Can you show me how you are declaring this dependency? This probably only works because of some missing validation in Gradle.

I don’t remember how it’s defined exactly, but it’s something like:

Wowza Media Server 3.6.2/lib/jid3lib-0.5.4

The right version I can send you just at this Tuesday, because we are on holidays until November 6.

That’s probably the issue - the dependency should just be “jid3lib:0.5.4”. “Media Server 3.6.2/lib/” should be added as a flatDir repository.

I don’t think so. It’s a ‘flat dependency’. I know best way define dependencies is a GAV record. But in our case, it’s definitely appropriate. Also, these 3rd party dependencies we got “AS IS” & it’s not a good idea try to manage these dependencies in an automatic manner at this time.

You are probably doing something like:

dependencies {
   compile "Wowza Media Server 3.6.2/lib/jid3lib-0.5.4"
}

Which is telling Gradle to look for an external dependency with empty group, empty version and artifact name = “Wowza Media Server 3.6.2/lib/jid3lib-0.5.4”.

If you just want a file dependency, then you should be using

dependencies {
   compile files("Wowza Media Server 3.6.2/lib/jid3lib-0.5.4")
}

Or you can use a flatDir repository. That makes the dependency declarations look a bit more tidy and similar to external dependencies:

repositories {
    flatDir {
        dirs 'Wowza Media Server 3.6.2/lib/'
    }
}
dependencies {
  compile “jid3lib:0.5.4”
}
1 Like