NoSuchMethodError On any SSH Source Dependency #28823
Labels
a:bug
🌳 help wanted
Taking contributor PRs, might need existing Gradle knowledge
in:source-dependencies
re:comprehensibility
reasonable errors and warnings, clear dsl, mental overload
Current Behavior
By simply replicating the source dependency configuration in the example article for source dependencies, it looks like SSH support no longer works. The JGit version that Gradle 8.7 includes appears to have been built with a different version of the Apache SSH libraries than what was included in the Gradle release.
settings.gradle.kts
app/build.gradle.kts
Gradle source dependencies are limited to SSH servers that support older encryption mechanisms, so this likely wouldn't work with a GitHub repo anyways, but it should at least attempt to connect with an authentication failure (there are plugins to fix the SSH encryption issues). However, Gradle 8.7 cannot get to the point of even trying to connect for 2 different reasons. The first:
At some point in the process, Gradle is inserting an additional '/' after the URI scheme, creating an invalid URI: ssh:///git@github.com:gradle/native-samples-cpp-library.git. If this is manually compensated for by removing one slash from the URI in settings.gradle.kts:
Another issue related to SSH source dependencies appears:
These issues do not appear in 8.6.
Expected Behavior
Using just this simple project in Gradle 8.6 yields the expected behaviour:
Context (optional)
I have developed a plugin that fixes the issues with SSH authentication on systems that do not support older encryption mechanisms by effectively modernizing the SSH implementation that Gradle uses, but with 8.7 JGit appears to be broken so this plugin cannot help at all, meaning that only up to 8.6 will work. I hope this is a simple fix to change the runtime dependencies that Gradle uses.
Thanks.
Steps to Reproduce
~ % mkdir myProject
~ % cd myProject
myProject % docker run --rm -u gradle -v "$PWD":/home/gradle/project -w /home/gradle/project gradle:8.7.0-jdk17 gradle init --type java-application --dsl kotlin
Edit settings.gradle.kts
Edit app/build.gradle.kts
myProject % ./gradlew clean build -s
Gradle version
8.7.0
Build scan URL (optional)
https://scans.gradle.com/s/4eat2hi5uiy2u
Your Environment (optional)
No response
The text was updated successfully, but these errors were encountered: