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. Linux C申请内存三种基本方式

    一份代码可以知道具体方式和原理: int main() { int stack_a; int stack_b; static int static_c; static int static_d; in ...

  2. 【ASP.NET Core】MVC模型绑定:自定义InputFormatter读取CSV内容

    在上一篇文章中,老周介绍了用自定义 ModelBinder 的方式实现一个 API(或MVC操作方法)可以同时支持 JSON 格式和 Form-data 格式的数据正文.今天该轮到 InputForm ...

  3. 如何使用 Spring Boot 实现分页和排序?

    使用 Spring Boot 实现分页非常简单.使用 Spring Data-JPA 可以实现将可分页的传递给存储库方法.

  4. C# 如何让new 出来的form显示在最外层?

    /// <summary> /// 显示比对不同点的位置 /// </summary> public void showDiffImage() { //在此处弹出不一样图 Bi ...

  5. 动态JDK代理方式-实现类增强

    需求描述: 抽取dao层开启和提交事物交由代理类一并执行 分析: 假如UserDao接口中有很多方法,例如addUser().deleteUser().updateUser()等等,需要频繁的和数据库 ...

  6. Java中带参数的方法和JavaScript中带参数的函数有什么不同?

    javascript是动态语言,是弱类型语言,其参数的使用很灵活:java则是强类型语言,参数的类型必须明确的

  7. 在 mapper 中如何传递多个参数?

    1.第一种: DAO 层的函数 public UserselectUser(String name,String area); 对应的 xml,#{0}代表接收的是 dao 层中的第一个参数,#{1} ...

  8. 利用Properties类关联相关配置文件

    文件目录 代码: package Lianxi;import java.io.FileInputStream;import java.io.FileNotFoundException;import j ...

  9. fsdfd

    static int kWeiOfVal(int val, int k) { int n = 1; int temVal = val; int result; while (1) { temVal = ...

  10. 使用jquery-webcam插件,实现人脸采集并转base64

    项目需求:在ie或chrome浏览器下,调用电脑摄像头(确保使用的是笔记本电脑,或者摄像头功能正常使用的台式机),进行人脸图像采集预览,并将图片的base64码传入到后台进行后续操作.该demo适用于 ...