zoukankan      html  css  js  c++  java
  • 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 注释掉,这样也是可以的。

  • 相关阅读:
    MFC菜单、工具栏和状态栏
    MFC控件
    MFC对话框
    MFC消息映射机制
    性能优化可使用的工具
    常见的内存问题分析思路
    k8s之Probe
    docker swarm
    keepalived配置虚拟ip(vip)实现双机热备以及自动切换主备
    linux安装openjdk1.8
  • 原文地址:https://www.cnblogs.com/hanwen1014/p/11324492.html
Copyright © 2011-2022 走看看