I got the hpi:run to work by adding the dependency as you suggest.

The thing is if I explicitly add the dependency to 2.7.1 in my plugin's POM, 
the execution fails with

FATAL: org.apache.xpath.XPathContext.<init>(Z)V
java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V
        at org.apache.xpath.jaxp.XPathImpl.eval(XPathImpl.java:207)
        at org.apache.xpath.jaxp.XPathImpl.evaluate(XPathImpl.java:281)
        at org.apache.ibatis.parsing.XPathParser.evaluate(XPathParser.java:204)
        at org.apache.ibatis.parsing.XPathParser.evalNode(XPathParser.java:195)
        at org.apache.ibatis.parsing.XPathParser.evalNode(XPathParser.java:191)
        at 
org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:69)
        at 
org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:537)
        at 
org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:307)
        at 
org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:282)
        at 
com.cisco.step.jenkins.plugins.jenkow.JenkowEngine.getEngine(JenkowEngine.java:74)
        at 
com.cisco.step.jenkins.plugins.jenkow.JenkowBuilder.perform(JenkowBuilder.java:66)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
        at 
hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:703)
        at hudson.model.Build$RunnerImpl.build(Build.java:178)
        at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
        at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:473)
        at hudson.model.Run.run(Run.java:1410)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:238)

But with an explicit dependency to 2.6.0 it works.

The missing XPathContext(boolean) constructor is only in 2.7.1, but not in 
2.6.0.
Strange.
-Max


On 04/25/2012 11:48 PM, Stephen Connolly wrote:
If you add athe dependency to the dependencies section of the hpi plugin (little 
known part of he XML schema) you can override to the newer one. Surefire might be 
trickier. Also if using maven < 3 in a multimodule build the first time a 
plugin is instantiated wins, which made the trick mostly useless until maven 3 was 
released

On Thursday, 26 April 2012, Max Spring wrote:

    The plugin I work on uses a library which in turn depends on 
xalan:xalan:2.7.1.
    When running as junit or through hpi:run, my plugin gets to see 
xalan:xalan:2.6.0 and barfs.

    The dependency chain (with hpi:run) is

      org.kohsuke.stapler:maven-__stapler-plugin:jar:1.16:__compile
         jaxen:jaxen:jar:1.1.1:compile
            xom:xom:jar:1.0:compile
               xalan:xalan:jar:2.6.0:compile

    Strangely it works in regular execution.

    Is there a way that my plugin can see xalan:2.7.1 even when running as 
hpi:run or junit?

    I run again Jenkins 1.455.

    Thanks!
    -Max


Reply via email to