1. 将本地的jar包加入maven dependency
<dependency>
<groupId>com.ebay.app.raptor.cs.qa</groupId>
<artifactId>ecaf</artifactId>
<version>0.0.1-SNAPSHOT</version>
<systemPath>${project.basedir}/lib/ecaf.jar</systemPath>
<scope>system</scope>
</dependency>
  2. 指定JDK的版本,以及字体
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<encoding>utf-8</encoding>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
  3. 将项目打成war包
  <packaging>war</packaging>
  4. 在jenkins job配置java main函数去启动job,首先, 在pom文件中配置如下
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.ebay.cs.qdash.dump.startup.Main</mainClass>  <!--你的main函数的路径-->
</manifest>
</archive>
</configuration>
</plugin>
</build>
  在jenkins的job配置如下: