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

Install Parent project

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

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依赖中加入标签,之前没加。

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

相关博客:
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

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

你可能感兴趣的:(Idea,maven,intellij-idea,maven,python)