报错详细信息
Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:tree (default-cli) on project springbootbd-product: Cannot build project depe
ndency graph: Could not resolve nor collect following dependencies: [jdk.tools:jdk.tools:jar:1.8 (system)]: Could not resolve dependencies for project com.sinosoft
:springbootbd-product:jar:0.0.1-SNAPSHOT: Could not find artifact jdk.tools:jdk.tools:jar:1.8 at specified path D:\Program Files\Java\jre1.8.0_201/../lib/tools.jar
解决方法
主要是Hadoop自带的tools与jdk的产生冲突所致,排除掉jdk的就可以了
在pom.xml加入下面的依赖
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.7.5</version>
<exclusions>
<exclusion>
<artifactId>jdk.tools</artifactId>
<groupId>jdk.tools</groupId>
</exclusion>
</exclusions>
<scope>provided</scope>
</dependency>
最终执行效果如下
————————————————
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/qq_44705151/article/details/138305104