Maven 打包報錯,log4j版本導致


# 在執行打包的時候
mvn clean assembly:assembly 
# 發生上面的錯誤
------------------------------
[INFO] Total time: 2.872 s
[INFO] Finished at: 2019-08-08T13:44:10+08:00
[INFO] Final Memory: 13M/168M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project FlinkTest: Could not resolve dependencies for project com.badou:FlinkTest:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: javax.jms:jms:jar:1.1, com.sun.jdmk:jmxtools:jar:1.2.1, com.sun.jmx:jmxri:jar:1.2.1: Could not transfer artifact javax.jms:jms:jar:1.1 from/to java.net (https://maven-repository.dev.java.net/nonav/repository): Cannot access https://maven-repository.dev.java.net/nonav/repository with type legacy using the available connector factories: BasicRepositoryConnectorFactory: Cannot access https://maven-repository.dev.java.net/nonav/repository with type legacy using the available layout factories: Maven2RepositoryLayoutFactory: Unsupported repository layout legacy -> [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] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

  從報錯來看,是由於缺少一些包導致的,經過搜索發現是由於 log4j 的版本導致的,打包的時候使用的版本是 1.2.15,發現將其升到 1.2.16 還是不行,但是升級到 1.2.17 就沒有這個問題了。

換成 1.2.17 是一種解決辦法。另外還可以找到對應的 jar 放到庫里面。最后一種辦法就是在打包的時候直接將 log4j 注釋掉,這樣也是可以的。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM