【IDEA使用maven package时,出现依赖不存在以及无法从仓库获取本地依赖的问题】

Install Parent project

在这里插入图片描述
在这里插入图片描述

C:\Users\lxh\.jdks\corretto-1.8.0_362\bin\java.exe -Dmaven.multiModuleProjectDirectory=D:\学习\projectFile\study\study_example_service "-Dmaven.home=D:\Program Files\JetBrains\IntelliJ IDEA2021\plugins\maven\lib\maven3" "-Dclassworlds.conf=D:\Program Files\JetBrains\IntelliJ IDEA2021\plugins\maven\lib\maven3\bin\m2.conf" "-Dmaven.ext.class.path=D:\Program Files\JetBrains\IntelliJ IDEA2021\plugins\maven\lib\maven-event-listener.jar" "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA2021\lib\idea_rt.jar=63004:D:\Program Files\JetBrains\IntelliJ IDEA2021\bin" -Dfile.encoding=UTF-8 -classpath "D:\Program Files\JetBrains\IntelliJ IDEA2021\plugins\maven\lib\maven3\boot\plexus-classworlds-2.6.0.jar;D:\Program Files\JetBrains\IntelliJ IDEA2021\plugins\maven\lib\maven3\boot\plexus-classworlds.license" org.codehaus.classworlds.Launcher -Didea.version=2021.1 -s D:\software\apache-maven-3.8.4\conf\settings.xml -Dmaven.repo.local=D:\software\apache-maven-3.8.4\mvn_resp -DskipTests=true package
[WARNING] 
[WARNING] Some problems were encountered while building the effective settings
[WARNING] Unrecognised tag: 'blocked' (position: START_TAG seen ...</url>\r\n      <blocked>... @184:16)  @ D:\software\apache-maven-3.8.4\conf\settings.xml, line 184, column 16
[WARNING] 
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------< com.lxh:study_example_service >--------------------
[INFO] Building study_example_service 1.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for com.lxh:study_common:jar:1.0.0 is missing, no dependency information available
[WARNING] The POM for com.lxh:study_dao:jar:1.0.0 is missing, no dependency information available
[WARNING] The POM for com.lxh:study_utils:jar:1.0.0 is missing, no dependency information available
[WARNING] The POM for com.alibaba:druid:jar:1.2.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The artifact mysql:mysql-connector-java:jar:8.0.32 has been relocated to com.mysql:mysql-connector-j:jar:8.0.32
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.503 s
[INFO] Finished at: 2023-11-01T17:38:52+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project study_example_service: Could not resolve dependencies for project com.lxh:study_example_service:jar:1.0.0: The following artifacts could not be resolved: com.lxh:study_common:jar:1.0.0, com.lxh:study_dao:jar:1.0.0, com.lxh:study_utils:jar:1.0.0: Failure to find com.lxh:study_common:jar:1.0.0 in http://maven.aliyun.com/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced -> [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

进程已结束,退出代码为 1

解决

在父项目(root)pom依赖中加入<pluginManagement></pluginManagement>标签,之前没加。

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

相关博客:
https://blog.csdn.net/qq_39826207/article/details/123917550
https://blog.csdn.net/qq_41988159/article/details/124761291
maven<pluginManagement>标签的作用:
https://blog.csdn.net/qq_27022241/article/details/108978554?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522169890834816777224460914%2522%252C%2522scm%2522%253A%252220140713.130102334…%2522%257D&request_id=169890834816777224460914&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduend~default-1-108978554-null-null.142v96pc_search_result_base6&utm_term=pluginmanagement%E6%A0%87%E7%AD%BE&spm=1018.2226.3001.4187

觉得对你有帮助点个赞哦爱你

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值