• 【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
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31

    解决

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

        <build>
            <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.springframework.bootgroupId>
                        <artifactId>spring-boot-maven-pluginartifactId>
                    plugin>
                plugins>
            pluginManagement>
        build>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10

    相关博客:
    https://blog.csdn.net/qq_39826207/article/details/123917550
    https://blog.csdn.net/qq_41988159/article/details/124761291
    maven标签的作用:
    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

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

  • 相关阅读:
    #ubuntu# #常用工具#
    万字长文Python面试题
    【ECMAScript6】Symbol及其相关使用
    92---Python 直角坐标系下绘制抛物线图像
    查看docker中的mysql版本,查看docker中容器,查看mysql版本
    python从入门到项目实战——基础语法
    CycleGAN论文解读+思想+学习路径
    Linux下PostgreSQL安装部署详细步骤
    在线教育项目【vue-element前端工程环境搭建】
    学习笔记-SQLi
  • 原文地址:https://blog.csdn.net/sinat_37828702/article/details/134166617