| We encountered the same problem in our own plugin that uses mksapi - and were able to solve it. The classloader of Jenkins plugins prefers classes from other plugins or Jenkins core to the classes bundled in the plugin itself, as documented here: https://jenkins.io/doc/developer/plugin-development/dependencies-and-class-loading/ If the Jenkins installation already contains a different version of org.apache.commons.httpclient.HttpConnection , you get this problem. That's why it's difficult to reproduce in another installation, because it depends on the exact version of plugins installed. We solved it in our plugin by configuring the classloader of our plugin to use its own classes for the given packages. Excerpt from POM.xml
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<configuration>
<maskClasses>
org.apache.commons.httpclient.
org.apache.commons.httpclient.auth.
org.apache.commons.httpclient.cookie.
org.apache.commons.httpclient.methods.
org.apache.commons.httpclient.methods.multipart.
org.apache.commons.httpclient.protocol.
org.apache.commons.httpclient.util.
</maskClasses>
</configuration>
</plugin>
|