1、错误内容:Could not resolve dependencies for project

今天在使用mvn clean package命令对一个子项目打包的时候出现如下错误(但是使用maven插件却没有问题)

Failed to execute goal on project xxxx: Could not resolve

dependencies for project xxxx:jar:0.0.1-SNAPSHOT:

Could not find artifact 公共包:jar:0.0.1-SNAPSHOT

在网上找了很多资料都没有找到相应的解决方法,有的说不要在公共模块添加maven插件,有的说在公共模块添加

<skip>true</skip>

但是都无济于事。

2、解决方案

通过控制台给出的建议

[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

看到这里头都大了,然后我自己思考了一下,为什么我引用的中心仓库的依赖打包时没有问题,但是引用我本地仓库的依赖(公共包)却有问题(提前需要对公共包进行mvn clean install,保证本地仓库有公共jar包)。然后就想到当时配置maven的时候配置了阿里云的远程仓库,如果我配置一下本地的仓库是不是也可以?因此,加入以下配置就解决了无法处理本地依赖包的问题

<localRepository>D:\maven\apache-maven-3.8.4\repository</localRepository>

添加的位置在mirrors标签前面

3、解决原理

我认为在没有配置本地仓库的情况下,使用命令进行打包的时候先找配置的仓库,找不到的话再寻找maven中心仓库,再找不到就报错。配置过本地仓库的情况下,就可以直接在本地仓库查找,因此就可以找到本地的公共包。

4、疑问

由于我需要使用函数计算对项目进行部署,想在部署前运行mvn clean package命令,结果出现了报错,但是使用maven插件如下

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.4</version>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

进行打包却没有问题,希望大佬进行指点。

彻底解决Failed to execute goal on project xxxxx的更多相关文章

  1. maven install报错 Failed to execute goal on project my-manager-mapper: Could not resolve dependencies for project com.my:my-manager-mapper:jar:0.0.1-SNAPSHOT:

    报错信息为: [ERROR] Failed to execute goal on project my-manager-mapper: Could not resolve dependencies f ...

  2. maven出现:Failed to execute goal on project ...: Could not resolve dependencies for project ...

    项目结构是一个父项目,多个子项目目录: 例如: common --------------(父项目) fristDemo    ------------(子项目) 如果在子项目中调用了父项目,而对(子 ...

  3. Failed to execute goal on project e3-manager: Could not resolve dependencies for project cn.e3mall:e3-manager:pom:0.0.1-SNAPSHOT: Could not find artifact cn.e3mall:e3-parent:jar:0.0.1-SNAPSHOT

    新建好工程后一定要记得从底层开始clean和install 在启动新建的工程时到最后一步出现了这个问题: Failed to execute goal on project e3-manager-we ...

  4. 安装maven工程报错"Failed to execute goal on project...Could not resolve dependencies for project..."

    我在qingcheng_interface中Lifecycle目录下执行install命令后报错"Failed to execute goal on project...Could not ...

  5. 解决Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project autotest_fchtgl: Compilation failure的方法

    在碰到maven install 发现报错 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:comp ...

  6. 解决Failed to execute goal org.apache.maven.plugins

    1.Maven构建失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: 2.3 . 2 :compile  ...

  7. 解决:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile

    在项目构建的时候遇到了这样的问题:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile(d ...

  8. 解决 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile)

    在项目构建的时候遇到了这样的问题:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile ...

  9. Failed to execute goal on project MakeFriends: Could not resolve dependencie The POM for .chengpai.jtd:jtd-service-api:jar:1.0-SNAPSHOT is missing, no dependency information available

    本笔者在学习maven的基础,然后建立了一个maven的项目,然后想对其进行依赖操作,pom.xml进行依赖操作时候出现了这样的错误,说是找不到这个依赖的包,但是事实上已经导入了这个包. 同时,也在m ...

随机推荐

  1. redis整理:常用命令,雪崩击穿穿透原因及方案,分布式锁实现思路,分布式锁redission(更新中)

    redis个人整理笔记 reids常见数据结构 基本类型 String: 普通key-value Hash: 类似hashMap List: 双向链表 Set: 不可重复 SortedSet: 不可重 ...

  2. nginx反向代理失败,又是 fastdfs 的锅

    fdfs问题记录 [root@hostcad logs]# systemctl status fdfs_trackerd.service ● fdfs_trackerd.service - LSB: ...

  3. 你如何确保 main()方法所在的线程是 Java 程序最后结束 的线程?

    我们可以使用 Thread 类的 join()方法来确保所有程序创建的线程在 main()方法退出前结束.

  4. Spring-boot-菜鸟-properties配置

    如果测试结果出现中文乱码: 结果": Person{lastName='张胜男', age=11, boss=false, birth=Wed Nov 11 00:00:00 CST 202 ...

  5. 学习k8s(一)

    一.安装及介绍 1.k8s架构 2.核心组件 3.其他组件 4.安装方式 yum安装: 1.5 最简单,版本低,适合学习 二进制安装: 最繁琐,可以用saltstack安装 kubeadm安装: 谷歌 ...

  6. poj_3253_priority queue

    描述 农夫约翰想要修篱墙,他需要N块木板,第i块板长Li.然后他买了一块很长的板子,足够他分成N块.忽略每次锯板子带来的损失. 约翰忘记买锯子了,于是像Don借.Don要收费,每次锯一下,就要收一次板 ...

  7. kbengine开源分布式游戏服务端引擎

    一款开源的支持多人同时在线实时游戏的服务端引擎,使用简单的约定协议就能够使客户端与服务端进行交互,使用KBEngine插件能够快速与(Unity3D.OGRE.Cocos2d.HTML5,等等)技术结 ...

  8. 【Android开发】【布局】 仿QQ的UI

    Demo地址

  9. Value注解获取值一直为Null

    @Value("${jwt.tokenHeader}") private String tokenHeader; 常见的错误解决办法如下: 1.使用static或final修饰了t ...

  10. linux-RHEL7.0 —— 《Linux就该这么学》阅读笔记

    目录 linux-RHEL7.0 安装部署 修改root密码 RPM(红帽软件包管理器) YUM(软件仓库) Systemd初始化进程 总结 linux命令 帮助命令 man 系统工作命令 echo ...