Abhinav Bakaya
02/04/2025, 6:32 AMAbhinav Bakaya
02/04/2025, 6:48 AMVampire
02/04/2025, 7:56 AMVampire
02/04/2025, 8:46 AMAbhinav Bakaya
02/04/2025, 9:38 AMAnze Sodja
02/04/2025, 10:07 AM--rerun-tasks
if that fixes it locally. This is pretty often the most effective way to fix local caches.Vampire
02/04/2025, 10:08 AMJulien Plissonneau Duquène
02/04/2025, 10:30 AMfind /...path-to-gradle-home... -name '*.jar' -exec sh -ec 'jar tf "$1" > /dev/null && printf . || printf "\nFAILED: %s" "$1"' sh \{\} \;
note that you have to use the slower jar
and not unzip
as the latter could complain on "false positives" (that are arguably broken ZIPs, but in a different way than your issue, and they happen to work as JARs).Abhinav Bakaya
02/04/2025, 10:50 AMVampire
02/04/2025, 10:54 AMVampire
02/04/2025, 10:54 AMVampire
02/04/2025, 10:55 AMorg.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin
artifact is a plugin marker, it only consists of a POM pointing to the actual code artifactVampire
02/04/2025, 10:55 AMVampire
02/04/2025, 10:56 AMAbhinav Bakaya
02/04/2025, 10:57 AMJulien Plissonneau Duquène
02/04/2025, 11:00 AMVampire
02/04/2025, 11:07 AMAbhinav Bakaya
02/04/2025, 11:07 AMVampire
02/04/2025, 11:08 AM--offline
(intentionally or accidentally) and thus do not get the broken stuff from remote, ...Vampire
02/04/2025, 11:08 AMJulien Plissonneau Duquène
02/04/2025, 11:09 AMJulien Plissonneau Duquène
02/04/2025, 11:10 AMJulien Plissonneau Duquène
02/04/2025, 11:11 AMVampire
02/04/2025, 11:11 AMAbhinav Bakaya
02/04/2025, 11:24 AMAbhinav Bakaya
02/04/2025, 11:25 AMrepositories {
maven {
url = uri("nexus-url-here/repository/maven2-proxy/")
isAllowInsecureProtocol = true
}
maven {
url = uri("nexus-url-here/repository/maven2-spring-proxy/")
isAllowInsecureProtocol = true
}
mavenCentral()
}
This is configured in all 6 of our gradle projects. I am able to manually browse both of these urls. However, the second one doesn't have any files. Can that cause this issue?Vampire
02/04/2025, 11:27 AMVampire
02/04/2025, 11:27 AMVampire
02/04/2025, 11:29 AMAbhinav Bakaya
02/04/2025, 11:38 AMJulien Plissonneau Duquène
02/04/2025, 11:40 AMcurl -s -D - https://...nexus-url-here.../repository/maven2-proxy/org/jetbrains/kotlin/jvm/org.jetbrains.kotlin.jvm.gradle.plugin/1.9.24/org.jetbrains.kotlin.jvm.gradle.plugin-1.9.24.pom -o /dev/null
and paste the output?Julien Plissonneau Duquène
02/04/2025, 11:43 AMHTTP/1.1 200 OK
...
Content-Type: application/xml; charset=UTF-8
Content-Length: 673
...
Abhinav Bakaya
02/04/2025, 11:46 AMAbhinav Bakaya
02/04/2025, 11:47 AMAbhinav Bakaya
02/04/2025, 12:07 PMVampire
02/04/2025, 12:11 PMVampire
02/04/2025, 12:11 PMVampire
02/04/2025, 12:12 PM--refresh-dependencies
to make sure Gradle does rerequest all the files, in case it was a temporary server-side problem that is resolved nowAbhinav Bakaya
02/04/2025, 12:14 PMAbhinav Bakaya
02/04/2025, 12:15 PMrm -rf ~/.gradle
. Is there anything else I can do for a workaround. This is a showstopper for us.Vampire
02/04/2025, 12:18 PMVampire
02/04/2025, 12:18 PMJulien Plissonneau Duquène
02/04/2025, 12:30 PMorg/jetbrains/kotlin/jvm/org.jetbrains.kotlin.jvm.gradle.plugin/1.9.24/org.jetbrains.kotlin.jvm.gradle.plugin-1.9.24.pom
, that should be:
<project xsi:schemaLocation="<http://maven.apache.org/POM/4.0.0> <http://maven.apache.org/xsd/maven-4.0.0.xsd>" xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>" xmlns="<http://maven.apache.org/POM/4.0.0>">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jetbrains.kotlin.jvm</groupId>
<artifactId>org.jetbrains.kotlin.jvm.gradle.plugin</artifactId>
<version>1.9.24</version>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-gradle-plugin</artifactId>
<version>1.9.24</version>
</dependency>
</dependencies>
</project>
you can try for yourself with the gradle plugin portal:
curl -s -D - <https://plugins.gradle.org/m2/org/jetbrains/>...
Julien Plissonneau Duquène
02/04/2025, 12:34 PMcurl
with .jar
instead of .pom
, it should not be a 200
(or other 2xx
) status codeJulien Plissonneau Duquène
02/04/2025, 12:37 PM.pom
with additional metadata is the one served by Maven Central actuallyVampire
02/04/2025, 12:39 PMAbhinav Bakaya
02/04/2025, 12:49 PMrepositories {
// Remote storage: <https://repo1.maven.org/maven2/>
maven {
url = uri("<https://repo1.maven.org/maven2/>")
isAllowInsecureProtocol = true
}
// Remote storage: <https://repo.spring.io/milestone>
maven {
url = uri("<https://repo.spring.io/milestone>")
isAllowInsecureProtocol = true
}
// maven { url = uri("<https://repo.spring.io/milestone>") }
mavenCentral()
// google()
}
Vampire
02/04/2025, 12:54 PM--refresh-dependencies
?Vampire
02/04/2025, 12:55 PMAbhinav Bakaya
02/04/2025, 12:59 PM--refresh-dependencies
now. And we are using Nexus as a proxy. I just disabled it.Abhinav Bakaya
02/04/2025, 1:01 PMVampire
02/04/2025, 1:01 PMVampire
02/04/2025, 1:02 PMAbhinav Bakaya
02/04/2025, 1:03 PMVampire
02/04/2025, 1:05 PMNicola Corti
02/04/2025, 2:26 PMVampire
02/04/2025, 2:48 PMNicola Corti
02/04/2025, 2:51 PMVampire
02/04/2025, 2:58 PM--refresh-dependencies
,
and those using some caching proxy or mirror may also have a poisened cache / proxy there so that --refresh-dependencies
would also not help. 🤷‍♂️
Hard to tell from outside where exactly the bad content is coming from if it still is coming, as some said (including in this thread here) that they deleted the Gradle caches and it still happens.Vampire
02/04/2025, 2:58 PM--offline
or similar.Nicola Corti
02/04/2025, 3:03 PMVampire
02/04/2025, 3:13 PMAbhinav Bakaya
02/04/2025, 3:54 PMAbhinav Bakaya
02/04/2025, 4:03 PMVampire
02/04/2025, 4:05 PMKT
.
But again, the published files of the Kotlin plugin are fine.
It is an infrastructure problem somewhere where a server gave ill responses, not something the Kotlin team could influence.Nicola Corti
02/04/2025, 4:15 PMVampire
02/04/2025, 4:38 PMJulien Plissonneau Duquène
02/04/2025, 5:14 PM.jar
as the .pom
says there is none
• the build could (and should IMO) use gradle's dependency verification (checking signatures) to reject the .jar
the latter one alone would still have failed the build, but at least with some useful reporting instead of having to test all .jars in cacheVampire
02/04/2025, 5:37 PM• should not even try to download aI suspect that the pom has a similar content, so was not able to be parsed as pom and thus the jar was searched. This behavior is indeed configurable by a Gradle build by configuring the metadata sources of a repository.as the.jar
says there is none.pom
Julien Plissonneau Duquène
02/04/2025, 5:55 PMcurl
on the .pom
did return valid data and they tried with --refresh-dependencies
. I suspect gradle to run the queries in parallel and not use the .pom
data to discard the .jar
data even if it got a valid status code, but that would require some testing to confirm the behaviour. Anyway we lack the results of the curl
on the .jar
on their proxy, and overall it still looks very much like proxy cache poisoning.