1. 程式人生 > >Jenkins自動部署:本地jar包無法下載{{1009}}

Jenkins自動部署:本地jar包無法下載{{1009}}

雖然本地已經安裝了jar,但是還是報本地安裝的jar無法找到

安裝命令:

mvn install:install-file -Dfile=ojdbc-6.0.jar -DgroupId=com.oracle  -DartifactId=ojdbc -Dversion=6.0 -Dpackaging=jar

mvn install:install-file -Dfile=pinyin-2.5.0.jar -DgroupId=pinyin  -DartifactId=pinyin -Dversion=2.5.0 -Dpackaging=jar

mvn install:install-file -Dfile=limp-framework-1.1.3-RELEASE.jar  -DgroupId=com.chinasofti  -DartifactId=limp-framework -Dversion=1.1.3-RELEASE -Dpackaging=jar -DgeneratePom=true  -DcreateChecksum=true

原因是 jenkins 與 作業系統上使用了不同的 maven本地倉庫 需要將 作業系統上.m2上的 jar 拷貝到 jenkins的倉庫 路徑 /var/lib/jenkins/.m2/repository

【總結:配置好maven地址後,配置本地倉庫最好配置jenkins預設的倉庫地址】

錯誤資訊

[INFO] chinasofti-uums-app ............................... FAILURE [25.568s]
[INFO] chinasofti-uums-web Maven Webapp .................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.059s
[INFO] Finished at: Sat May 12 18:54:19 CST 2018
[INFO] Final Memory: 7M/29M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project chinasofti-uums-app: Could not resolve dependencies for project chinasofti-uums:chinasofti-uums-app:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: com.chinasofti:limp-framework:jar:1.1.3-RELEASE, com.oracle:ojdbc:jar:6.0, pinyin:pinyin:jar:2.5.0: Could not find artifact com.chinasofti:limp-framework:jar:1.1.3-RELEASE in central (
http://repo.maven.apache.org/maven2
) -> [Help 1]
[ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <goals> -rf :chinasofti-uums-app Build step 'Invoke top-level Maven targets' marked build as failure Finished: FAILURE