does "mavenCentral" really need to be included in ...
# community-support
c
does "mavenCentral" really need to be included in pluginManagment? I assume it's needed if a plugin has dependencies?
e
for historical reasons, plugin portal proxies jcenter. but yes if the plugin has any dependencies that aren't on the portal (or jcenter) then you need to add wherever it is (such as mavenCentral)
👍 1
s
Some plugins also don't get published to the portal at all, but only to Maven Central (see e.g. https://github.com/vanniktech/gradle-maven-publish-plugin/issues/669). These obviously also need
mavenCentral()
added.
👍 1
v
That's not fully correct. Gradle Plugin Portal redirects to JCenter for dependencies it does not serve itself. JCenter forwards to MavenCentral for dependencies it does not serve itself. So by having Gradle Plugin Portal, you have automatically all three repositories, as long as JCenter does not have one of its regular outages. Having
mavenCentral()
after
gradlePluginPortal()
is useless, because either the portal already served it directly or indirectly or got an error which causes the second not to be tried at all. Having
mavenCentral()
before
gradlePluginPortal()
can save you a small amount of time as the indirection through JCenter is not necessary and can save you from JCenter outages if the actual dependency is on MavenCentral, not JCenter.
c
redirects or proxies? not that it matters much to me, if it's really unnecessary
e
yeah I shouldn't have said proxy, it should be an http redirect on resources that the portal doesn't itself host
I am not sure if jcenter -> mavenCentral thing really works though, I remember having issues without an explicit `mavenCentral()`… or maybe that was due to some artifacts being different between the two
in any case I would put
mavenCentral()
first or limit what content comes portal/jcenter to specific modules
c
what's a plugin marker?
v
redirects or proxies? not that it matters much to me, if it's really unnecessary
I was careful with the terminology. 😉 Gradle Plugin Portal redirects to JCenter, JCenter forwards to (i.e. proxies) Maven Central.
what's a plugin marker?
https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_markers
c
so, if you have a plugin that does the inverse of what the aforementioned plugin does. Meaning at one point they published on maven central, too, and now they only publish to the portal. I'm guessing the inverse problem that's being experienced there will happen?
v
Not sure what you are trying to ask
Why should there be a problem?
Repositories are asked in order like for dependencies
If the first does not have what is looked for, the next is asked
It's not about "plugin X" is there or not, but the exact artifacts that are requested, or at least including version
c
in the afformentioned plugin they've stopped publishing to portal, so people are getting an old version. Which is why @ephemient is saying to put
mavenCentral()
first. Seems to me that the same problem might be true of another plugin which stopped publishing to
mavenCentral()
basically, I think the right answer is to use the portal and ignore bad behaving plugins
v
Ah, you only get an old version if you use dynamic versions maybe
c
they need to remove their code from the portal if they aren't going to keep it updated
v
Just use concrete versions and you are fine 🙂
e
removing from repositories isn't a thing you are expected to ever do with maven repositories
c
who wants to do that? it'd ruin my magically self updating build
v
Also better for not suddenly getting breaking builds due to plugin updates
c
nah, that's good detection 😉
v
I never use dynamic versions
e
dynamic versions are bad and dynamic plugin versions especially
c
and the reasons for lockfiles 😉
v
Yeah, well, then you are doomed probably 😄
c
but it seems like you would never find out their was a new version... the dynamic version wouldn't find it, correct?
v
Iirc. when looking for a dynamic version, it checks the first repo, if it finds in the available versions a version that matches the dynamic version, no further repositories are checked
c
if I point at the portal, a dynamic version'll never find the new version on maven central
right, exactly
so this problem exists no matter what
v
Tbh, everyone publishing a plugin and not publishing to the portal (at least additionally) is majorly doing something wrong anyway
c
yeah, I'd agree
I'd stop using that plugin on that basis
v
That also means the web ui only shows the latest version deployed to the portal or not list the plugin at all if always only published to MC
c
or make it explicitly resolve to maven central and not have all things check there first
v
Actually that argument with the dynamic versions that I didn't have in mind, might be a good enough reason to stop them doing that non-sense 😄
c
as a side note to this, is there any way to have the portal show "deprecated" or "unmaintained"?
or really any information at all from the source?
v
Initiated by whom?
c
the author
v
The plugin author can probably update the description
c
is there a way to do that without publishing a new version?
since the old version's gradle didn't work anymore
for whatever reason 5.x(something) was just busted
v
At least via https://github.com/gradle/plugin-portal-requests/ if there is no other way
👍 1