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 注释掉,这样也是可以的。

原文地址:https://www.cnblogs.com/hanwen1014/p/11324492.html

时间: 2024-11-02 15:41:33

Maven 打包报错,log4j版本导致的相关文章

maven打包报错问题解析

1. 场景描述 Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean) on project sptest: Failed to clean project: Failed to delete 2. 解决方案 2.1 问题定位 错误发生在idea下时候clean命令,很明显问题发生在clean的时候target这个文件夹下的文件删除不了. (1)难道无意中打开了配

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? idea maven 打包报错问题解决

mvn clean install -X -Dmaven.test.skip=true -P dev 打包报错:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? idea,项目,maven 也设置了统一的jdk,还是报错, 解决方法1:在maven的setting.xml 文件 <profiles> 标签中加入指定JDK的版本, <profile

maven 打包报错 生成javadoc 时有问题

项目是基于maven管理的,一直打包都好着呢,今天打包莫名奇妙的报了一大堆错误 [ERROR] java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc [ERROR] at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(AnnotationDescImpl

maven打包报错:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test

mvn compile  没有问题,mvn package的时候报如下错误: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test 解决方法: 打包跳过测试有两种方法 一是命令行, mvn clean package -Dmaven.test.skip=true 二是写入pom文件, <plugin> <groupId>org.apache.maven.plugins</g

maven打包报错:Failed to execute goal org.apache.maven

mvn compile  没有问题,mvn package的时候报如下错误: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test 解决方法: 打包跳过测试有两种方法 一是命令行,mvn clean package -Dmaven.test.skip=true 二是写入pom文件,<plugin>          <groupId>org.apache.maven.plugin

[转]maven打包报错:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test

源文URL:http://blog.csdn.net/caiwenfeng_for_23/article/details/44514947 mvn compile  没有问题,mvn package的时候报如下错误: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test 解决方法: 打包跳过测试有两种方法 一是命令行,mvn clean package -Dmaven.test.skip=tr

maven install 打包 报错 Cannot run program &quot;gpg.exe&quot;: CreateProcess error

打包报错, mvn install后加上参数-Dgpg.skip,例如:mvn install -Dgpg.skip   即可解决. 我们也可以去掉 这个 插件   <plugin>                <groupId>org.apache.maven.plugins</groupId>                <artifactId>maven-gpg-plugin</artifactId>                &l

spark-maven打包报错

maven打包时报错: 报错信息: "D:\Program Files\Java\jdk1.8.0_131\bin\java" -Dmaven.multiModuleProjectDirectory=D:\Workspace\IDEA_work\Spark_Work\spark01\sparkCore "-Dmaven.home=D:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1\plugins\maven\lib\maven3

关于Webpack打包报错Class constructor FileManager cannot be invoked witchout &#39;new&#39;

前端代码部署一直是自己打包之后将文件用FileZilla上传到服务器上,现在改用运维基于到k8s docker镜像的发布,前端打包报错如下: 经查资料,报错原因是less升级导致的Bug 尝试升级less-loader到5.0.0已解决上面问题. 关于Webpack打包报错Class constructor FileManager cannot be invoked witchout 'new' 原文地址:https://www.cnblogs.com/vikki7/p/11392744.htm