Using sshd-core in the git plugin

37 views
Skip to first unread message

Mark Waite

unread,
Aug 6, 2021, 11:08:05 AM8/6/21
to Jenkins Developers
The git credentials binding project in Google Summer of Code is making progress on private key support.  Private keys are working on Windows with investigation exploring non-Windows environments.

The pull request includes a reference to the sshd-core library from the Apache Mina project.  That reference allows the plugin to read and write private key files, including passphrase protected private key files.  However, that reference also causes two unrelated automated tests to fail with the message:

java.lang.ClassNotFoundException: org.jenkinsci.main.modules.sshd.SshCommandFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
Caused: java.lang.NoClassDefFoundError: org/jenkinsci/main/modules/sshd/SshCommandFactory
at java.lang.ClassLoader.defineClass1(Native Method)

The Apache Mina classes are referenced through their shaded location as provided by the sshd plugin.  That works at runtime (at least on Windows), but causes these test failures.

Any guidance on the preferred approach to use a library (sshd-core) that is part of a plugin (sshd) that was previously part of Jenkins core?

Mark Waite

Tim Jacomb

unread,
Aug 6, 2021, 12:15:29 PM8/6/21
to Jenkins Developers
I replied on the PR. 

You aren't using the sshd provided copy but instead are using the jenkins cli one

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/016fd04a-f2e5-45e8-9ece-b7a89353ce33n%40googlegroups.com.

Mark Waite

unread,
Aug 9, 2021, 8:10:36 PM8/9/21
to Jenkins Developers
The test failure that started this investigation is actually unrelated to the changes made in the pull request.

The git plugin master branch fails in the same way when `jenkins.version` is changed from 2.263.1 to 2.289.1.  No change in any other component, simply increase the minimum required Jenkins version and the test fails with an ASM related exception.

I'm prone to disable that test for now and leave it for later investigation.
Reply all
Reply to author
Forward
0 new messages