Problem with pipeline as a code dependency (workflow-aggregator)

74 views
Skip to first unread message

Ido Gadiel

unread,
Aug 1, 2016, 4:54:22 AM8/1/16
to Jenkins Developers
Hello
After a long time of debugging my plugin and couldn't find a solution, I decided to create a new "clean" plugin and try to reproduce the exception.
My project runs on Jenkins version 1.642.3, contain pom with only 1 dependency:
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-aggregator</artifactId>
<version>2.2</version>
<optional>true</optional>
</dependency>

And a simple test that use a JenkinsRule.

I get this exception while Im trying to run the test: "clean test -DskipTests=false -Dtest=myTest" (but it runs perfectly on regular run, e.g hpi:run -Djetty.port=9192)
java.lang.InstantiationException: java.lang.NoClassDefFoundError: org/jenkinsci/main/modules/sshd/SshCommandFactory
at net.java.sezpoz.IndexItem.element(IndexItem.java:146)
at hudson.ExtensionFinder$Sezpoz.scout(ExtensionFinder.java:666)
at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:382)

*i don't get this exception without workflow-aggregator dependency.

Any ideas?
thanks!


Jesse Glick

unread,
Aug 4, 2016, 10:49:12 AM8/4/16
to Jenkins Dev
On Mon, Aug 1, 2016 at 4:54 AM, Ido Gadiel <idog...@gmail.com> wrote:
> I get this exception while Im trying to run the test: "clean test -DskipTests=false -Dtest=myTest" (but it runs perfectly on regular run, e.g hpi:run -Djetty.port=9192)
> java.lang.InstantiationException: java.lang.NoClassDefFoundError: org/jenkinsci/main/modules/sshd/SshCommandFactory

Harmless, and can be worked around by adding an explicit dependency on
the SSHD module, but best to get rid of the `workflow-aggregator`
dependency and use the ones you actually need: at least `workflow-cps`
and `workflow-job`, typically some others like `workflow-basic-steps`
and/or `workflow-durable-task-step`.

And use `<scope>test</scope>` not `<optional>true</optional>`.
Reply all
Reply to author
Forward
0 new messages