Jenkins Maven Plugin: Classloading Feature
Good time!
Our team uses Maven. One of the project modules has a plugin
(maven-jibx-plugin) that requires (for our use-case) a dependency on a
proprietary jar:
<plugin>
<groupId>org.jibx</groupId>
<artifactId>jibx-maven-plugin</artifactId>
<version>${jibx.version}</version>
<executions>
<execution>
<id>main-schemas</id>
<phase>generate-sources</phase>
<goals>
<goal>schema-codegen</goal>
</goals>
<configuration>
<schemaLocation>
...
</schemaLocation>
<includeSchemas>
...
</includeSchemas>
<customizations>
<customization>${basedir}/src/main/resources/customizations/customization.xml
</customization>
</customizations>
<verbose>true</verbose>
</configuration>
</execution>
<execution>
<id>bind</id>
<phase>process-classes</phase>
<goals>
<goal>bind</goal>
</goals>
<configuration>
<schemaBindingDirectory>
${basedir}/src/main/resources/bindings
</schemaBindingDirectory>
<includeSchemaBindings>
<includeSchemaBinding>*.xml</includeSchemaBinding>
</includeSchemaBindings>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>proprietary-jar</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
</plugin>
The problem is when we build the project locally (and even from a command
line on the remote machine where jenkins is istalled), everything builds
successfully, but when our jenkins instance tries to build it - the build
fails with such a message: "Unable to find class
'class-name-from-the-proprietary-jar'". This problem occurred loccally
before we added the plugin dependency..
Seems like there is some feature of jenkins maven plugin that do no
resolve the plugin dependencies or may be there are some well-known
feature of the jenkins maven plugin classloading (JiBX loads proprietary
classes with such a construct:
SchemaRootBase.class.getClassLoader().loadClass(cname))... Can somebody,
please, suggest the workaround?
UPDATE: it turned out that the jenkins instance's JAVA_HOME variable is
set to /usr/java/jdk1.7.0_25. Could it be that the problem is in the 1.7
java version?
No comments:
Post a Comment