Yes, I have tried that but that is not the case here.

What I am doing is trying to create a javax.naming.InitialContext. This 
constructor takes a properties file with the property 
'java.naming.factory.initial', which indicates the class name of the 
initial index factory. This class is contained in one of the jar files that 
I have in my plugin project, and it appears the the InitialContext class 
tries to load this class. When it does I get an error indicating that the 
class can not be found.

In order to make it work, I had to change the maven dependencies for this 
jar file (and two others) to "provided" so they were not packaged up with 
the plugin.  I then manually installed the jars in 
<Jenkins_Home>/WEB-INF/lib, installed my plugin, restarted Jenkins, and 
things worked just fine.

It's possible there could be another way to do this so the jars could 
simply be left with the plugin, but I haven't been able to get it to work. 
When I print out the CLASSPATH in my plugin code I only see the war file:

INFO: CLASSPATH => /usr/lib/jenkins/jenkins.war

And that war file does not contain my jar files.

Any suggestions?

-- Greg



On Tuesday, February 25, 2014 9:47:44 AM UTC-5, Jesse Glick wrote:
>
> On Tue, Feb 25, 2014 at 9:44 AM, gallen <[email protected] <javascript:>> 
> wrote: 
> > Is there a way to automate this so it will happen during normal plugin 
> installation? 
>
> Normally you would simply declare a Maven dependency on the desired 
> libraries from your plugin. Then those classes will be accessible from 
> plugin classes. (The JARs will not be in WEB-INF/lib/ but that does 
> not normally matter.) 
>

-- 
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