2019-04-09 0920 星期二
比如手动把包添加到项目的lib下:com.ibm.mq-7.0.1.5.jar
pom配置:[本地启动是没有问题,jenkins自动打包就会识别不到包]
<dependencies>
<dependency>
<groupId>com.ibm</groupId>
<artifactId>mq</artifactId>
<version>7.0.1.5</version>
<systemPath>${project.basedir}/WebContent/WEB-INF/lib/com.ibm.mq-7.0.1.5.jar</systemPath>
<scope>system</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>compile</defaultGoal>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<archive>
<manifest>
<mainClass>com.xx.abc.platform.container.Plnadapter_Main_Provider</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<manifestEntries>
<Class-Path>
lib/cxf-api-2.7.14.jar lib/cxf-rt-bindings-soap-2.7.14.jar lib/com.ibm.mq-7.0.1.5.jar lib/com.ibm.mq.jmqi-7.0.1.5.jar
</Class-Path><!-- 只能放在一行,每个包之前用空格隔开,不能换行,换行了jenkins不可识别,每个包必需带版本号,否则也不识别 -->
</manifestEntries>
</archive>
<classesDirectory>
</classesDirectory>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
正确的pom
<dependencies>
<dependency>
<groupId>com.ibm</groupId>
<artifactId>com.ibm.mq</artifactId><!-- ** artifactId + version = 在lib下的jar名字 **-->
<version>7.0.1.5</version>
<systemPath>${project.basedir}/WebContent/WEB-INF/lib/com.ibm.mq-7.0.1.5.jar</systemPath>
<scope>system</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>compile</defaultGoal>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<archive>
<manifest>
<mainClass>com.xx.abc.platform.container.Plnadapter_Main_Provider</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<manifestEntries>
<Class-Path>
lib/cxf-api-2.7.14.jar lib/cxf-rt-bindings-soap-2.7.14.jar lib/com.ibm.mq-7.0.1.5.jar lib/com.ibm.mq.jmqi-7.0.1.5.jar
</Class-Path><!-- 只能放在一行,每个包之前用空格隔开,不能换行,换行了jenkins不可识别,每个包必需带版本号,否则也不识别 -->
</manifestEntries>
</archive>
<classesDirectory>
</classesDirectory>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
lib目录:
具体的包