This message was deleted.
# community-support
s
This message was deleted.
2
🚨 1
t
Looks like! I have the same issue. Cloudflare says the host is down.
1
v
Seems to work now
c
Confirmed
t
t
Reminder to always reconfigure your builds to go to
mavenCentral()
before
gradlePluginPortal()
so you're not impacted by JCenter (or Gradle's JCenter mirror) flaky availability. The only downside is that you'll also reach to Central for the artifacts actually hosted on the Gradle Plugin Portal, that's a small price to pay for a more stable build environment. (also, JCenter still rewrites some POM files from time to time, breaking Gradle verification metadata) https://github.com/gradle/gradle/issues/15406
Copy code
repositories {
    mavenCentral()
    gradlePluginPortal()
}
d
@Thomas Broyer where exactly should we put this:
Copy code
repositories {
    mavenCentral()
    gradlePluginPortal()
}
Does it go inside the
buildscript
block? or inside
pluginManagement
block?
v
pluginManagement
, you should practically never use
buildscript
1
t
And if you use
buildSrc
or an included build for convention plugins, also put it in that project's settings in both
pluginManagement
and
dependencyResolutionManagement
.
1
p
i publish all my plugins to both ... but i believe not all plugins are published to central, only gradle (it is a lot easier than publishing to central)
t
Plugins themselves are not the problem, their dependencies are. Plugins are hosted directly by the Gradle Plugin Portal, and that's OK. Their dependencies aren't, and the Gradle Plugin Portal will then redirect to JCenter (or Gradle's JCenter mirror). Putting Central first ensures that those will be downloaded from Central rather than JCenter. For plugins that aren't on Central (most of them), Central will return a 404 and Gradle will fallback to the Gradle Plugin Portal, and you should never actually use JCenter.
s
Correct me if I'm wrong, but didn't Jcenter shutdown on 2/1/2022? Shouldn't the redirect have been removed by this point?
t
JCenter is kept readonly "indefinitely" (that is, except when it's down). It cannot easily be put aside as some dependencies are only available in JCenter and not in, say, Central; so changing the behavior of the Gradle Plugin Portal would mean possibly breaking oldish projects whose plugins depend on libs that are only available on JCenter (or possibly plugins themselves only available on JCenter, and neither on the Gradle Plugin Portal nor Central)