Slackbot
10/11/2023, 5:53 PMLouis Jacomet
10/16/2023, 7:32 PMTadeas Kriz
10/16/2023, 9:16 PMco.touchlab.skie and it's currently in Maven Central only. I wanted to publish the plugin to the portal, but I couldn't figure out how to publish all of our artifacts to the Gradle Plugin repository, not just the plugin one.
What I meant by caching was the JCenter caching or a local cache. I'm not sure which one is it and it's not really reproducible. But it has happened to many of our users, all over the globe. And they didn't have mavenLocal as a plugin repository configured, so that shouldn't be it.Tadeas Kriz
10/19/2023, 1:05 PMLouis Jacomet
10/19/2023, 1:30 PMTadeas Kriz
10/19/2023, 1:30 PMTadeas Kriz
10/19/2023, 1:32 PMTadeas Kriz
10/24/2023, 3:57 PM.pom file artifact is returned, but the .module returns 404.
4. Even though the .pom file contains the <!-- do_not_remove: published-with-gradle-metadata -->, Gradle ignores the fact that it couldn't find the .module and resolves just the .pom.
5. Because of this the variant is not resolved correctly and a basically empty (metadata) .jar file is loaded on classpath
Running Gradle again does nothing, because Gradle has already cached that the .module doesn't exist. The only way for a user to get it working is running Gradle with --refresh-dependencies.
Is this an expected behavior? It seems a little weird that Gradle ignores the missing .module without even a warning. Or is it some misconfiguration on our side? Thanks!Louis Jacomet
10/24/2023, 4:03 PMLouis Jacomet
10/24/2023, 4:06 PMTadeas Kriz
10/24/2023, 4:08 PMTadeas Kriz
10/24/2023, 4:08 PMTadeas Kriz
10/24/2023, 5:49 PM.jar file in the "root" artifact (where the .module is to tell Gradle about the variants) and I'd say the error is slightly better - erroring out that it can't find the .jar. Honestly it'd be best if we could force Gradle to fail when it can't find the .module, because now the behavior is really weird.
I also noticed that Gradle will cache the "non-existence" of even the .jar artifact, so when I've put it back in the repository, it still says "not found" until I run --refresh-dependencies. Is that also expected?Tadeas Kriz
10/24/2023, 6:31 PMLouis Jacomet
10/25/2023, 1:26 PM404. Without that, declaring multiple repositories would be a serious performance issue as Gradle would have to retry repositories where an artifact is not every time.
That blog post has outdated information, the plugin portal currently redirects directly to JCenter.
Regarding the setup and mandating the use of the module file. You can do it, at the cost of complicating a bit the repository declaration.
By combining content filtering and metadata sources, you can make sure that artifacts that you know have a module file are sourced from a repo that ignores the pom.
Something like (did not test it):
repositories {
maven {
url = uri("<https://repo.mycompany.com/repo>")
metadataSources {
gradleMetadata()
}
content {
includeGroup("my.company")
}
}
maven {
url = uri("<https://repo.mycompany.com/repo>")
metadataSources {
mavenPom()
}
content {
excludeGroup("my.company")
}
}
}Tadeas Kriz
10/25/2023, 1:28 PMpluginManagement {
repositories {
gradlePluginPortal {
metadataSources {
...
...Louis Jacomet
10/25/2023, 1:28 PMTadeas Kriz
10/25/2023, 1:29 PMTadeas Kriz
10/25/2023, 1:29 PMclasspath to Gradle Plugin Portal?Louis Jacomet
10/25/2023, 1:29 PMTadeas Kriz
10/25/2023, 1:30 PM