I am trying to make the "Coverity" post-build action conditional on a variable 
by using the Flexible Publish Plugin.  
When I configure a job to use Coverity unconditionally, Jenkins ends up calling 
the decorate() method (I added a dummy logger.log call):

SEVERE: Created 
CoverityTempDir:jenkins.plugins.coverity.CoverityTempDir@37a2c490
java.lang.Exception: dummy stack trace exception
        at 
jenkins.plugins.coverity.CoverityLauncherDecorator.decorate(CoverityLauncherDecorator.java:98)
        at hudson.Launcher.decorateFor(Launcher.java:654)
        at hudson.model.Slave.createLauncher(Slave.java:346)
        at 
hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:631)
        at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:562)
        at hudson.model.Run.execute(Run.java:1593)
        at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:491)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:247)

That creates a CoverityTempDir object, adds it to the AbstractBuild object 
using addAction(), and later when the CoverityPublisher class runs it can 
retrive it and use it, and everything works fine.

However, when I try to make the Coverity step conditional, I get an NPE:

Strings match run condition: string 1=[Yes], string 2=[Yes]
Run condition [Strings match] enabling perform for step [Coverity]
ERROR: Publisher org.jenkins_ci.plugins.flexible_publish.FlexiblePublisher 
aborted due to exception
java.lang.NullPointerException
        at 
jenkins.plugins.coverity.CoverityPublisher.perform(CoverityPublisher.java:406)
        at 
org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110)
        at 
org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154)
        at 
org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105)
        at 
org.jenkins_ci.plugins.flexible_publish.ConditionalPublisher.perform(ConditionalPublisher.java:88)
        at 
org.jenkins_ci.plugins.flexible_publish.FlexiblePublisher.perform(FlexiblePublisher.java:96)
        at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:27)
        at 
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
        at 
hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
        at 
hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:964)
        at 
hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
        at hudson.model.Run.execute(Run.java:1618)
        at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:491)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:247)

In this case, it seems that it is null because 
CoverityLauncherDecorator.decorate() is never called.  Is this a problem with 
the Flexible Publish Plugin, or is the Coverity plugin doing something wrong?

Thanks,
Eric

-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to