1. 依赖本地jar包:
<dependency> <groupId>jsch</groupId> <artifactId>jsch</artifactId> <version>0.1.44</version> <scope>system</scope> <systemPath>${project.basedir}\src\main\webapp\WEB-INF\lib\jsch-0.1.44.jar</systemPath> </dependency>
2. 本地 用maven clean package打的war包里面有jar,放到Jenkins上打包就报错了。错误如下:
Failed to execute goal on project ibisv3: Could not resolve dependencies for project *test:war:3.0: The following artifacts could not be resolved: jsch:jsch:jar:0.1.44, smshenan:smshenan:jar:1.0: Could not find artifact jsch:jsch:jar:0.1.44 at specified path /home/workspace/JR01_ktz_IBIS_tomcat_mysql_zh_219war\src\main\webapp\WEB-INF\lib\jsch-0.1.44.jar -> [Help 1]
3. 原因:路径写错了,修改成/src/main/webapp/WEB-INF/lib就好了
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/jsch-0.1.44.jar</systemPath>
来源:https://blog.csdn.net/zhaoyingjiao/article/details/100545007