美好时光!
我们的团队使用 Maven。其中一个项目模块有一个插件(maven-jibx-plugin),它需要(对于我们的用例)对专有 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>
问题是当我们在本地构建项目时(甚至从安装 jenkins 的远程计算机上的命令行),一切都成功构建,但是当我们的 jenkins 实例尝试构建它时 - 构建失败并显示以下消息:“ Unable to find class 'class-name-from-the-proprietary-jar'” . 在我们添加插件依赖项之前,此问题在本地发生..
似乎 jenkins maven 插件的某些功能无法解决插件依赖关系,或者可能存在 jenkins maven 插件类加载的一些众所周知的功能(JiBX 使用这样的构造加载专有类SchemaRootBase.class.getClassLoader().loadClass(cname):插件应该提供有关所需类的知识)...有人可以建议解决方法吗?
更新: 
原来 jenkins 实例的 JAVA_HOME 变量设置为/usr/java/jdk1.7.0_25,但在我的 maven-compiler-plugin 中我有<target>1.6</target>. 会不会是 1.7 java 版本的问题?