个人主页:  温情

系列专栏:        《踩坑日记》

•ࡇ•      山高路远,看世界也找自己


今天分享一个在项目开发中的踩坑笔记:

报错信息

"C:\Program Files\Java\jdk-1.8\bin\java.exe" -Dmaven.multiModuleProjectDirectory=D:\IdeaProjects\API\kun-api-master\kun-api-master -Djansi.passthrough=true -Dmaven.home=D:\develop\apache-maven-3.6.1 -Dclassworlds.conf=D:\develop\apache-maven-3.6.1\bin\m2.conf "-Dmaven.ext.class.path=D:\develop\idea\IntelliJ IDEA 2023.3.2\plugins\maven\lib\maven-event-listener.jar" "-javaagent:D:\develop\idea\IntelliJ IDEA 2023.3.2\lib\idea_rt.jar=65488:D:\develop\idea\IntelliJ IDEA 2023.3.2\bin" -Dfile.encoding=UTF-8 -classpath D:\develop\apache-maven-3.6.1\boot\plexus-classworlds-2.6.0.jar org.codehaus.classworlds.Launcher -Didea.version=2023.3.2 -s D:\develop\apache-maven-3.6.1\conf\settings.xml -Dmaven.repo.local=D:\develop\apache-maven-3.6.1\mvn_repo -DskipTests=true clean
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.kun:kun-api-backend:0.0.1: Failure to find com.kun:kun-api:pom:0.0.1 in https://maven.aliyun.com/repository/public was cached in the local repository, resolution will not be reattempted until the update interval of aliyunmaven has elapsed or updates are forced and 'parent.relativePath' points at no local POM @ line 6, column 13
[FATAL] Non-resolvable parent POM for com.kun:kun-api-interface:0.0.1: Failure to find com.kun:kun-api:pom:0.0.1 in https://maven.aliyun.com/repository/public was cached in the local repository, resolution will not be reattempted until the update interval of aliyunmaven has elapsed or updates are forced and 'parent.relativePath' points at no local POM @ line 5, column 13
[FATAL] Non-resolvable parent POM for com.kun:kun-api-gateway:0.0.1-SNAPSHOT: Failure to find com.kun:kun-api:pom:0.0.1 in https://maven.aliyun.com/repository/public was cached in the local repository, resolution will not be reattempted until the update interval of aliyunmaven has elapsed or updates are forced and 'parent.relativePath' points at no local POM @ line 5, column 13
[FATAL] Non-resolvable parent POM for com.kun:kun-api-common:0.0.1: Failure to find com.kun:kun-api:pom:0.0.1 in https://maven.aliyun.com/repository/public was cached in the local repository, resolution will not be reattempted until the update interval of aliyunmaven has elapsed or updates are forced and 'parent.relativePath' points at no local POM @ line 5, column 13
 @ 
[ERROR] The build could not read 4 projects -> [Help 1]
[ERROR]   
[ERROR]   The project com.kun:kun-api-backend:0.0.1 (D:\IdeaProjects\API\kun-api-master\kun-api-master\kun-api-backend\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.kun:kun-api-backend:0.0.1: Failure to find com.kun:kun-api:pom:0.0.1 in https://maven.aliyun.com/repository/public was cached in the local repository, resolution will not be reattempted until the update interval of aliyunmaven has elapsed or updates are forced and 'parent.relativePath' points at no local POM @ line 6, column 13 -> [Help 2]
[ERROR]   
[ERROR]   The project com.kun:kun-api-interface:0.0.1 (D:\IdeaProjects\API\kun-api-master\kun-api-master\kun-api-interface\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.kun:kun-api-interface:0.0.1: Failure to find com.kun:kun-api:pom:0.0.1 in https://maven.aliyun.com/repository/public was cached in the local repository, resolution will not be reattempted until the update interval of aliyunmaven has elapsed or updates are forced and 'parent.relativePath' points at no local POM @ line 5, column 13 -> [Help 2]
[ERROR]   
[ERROR]   The project com.kun:kun-api-gateway:0.0.1-SNAPSHOT (D:\IdeaProjects\API\kun-api-master\kun-api-master\kun-api-gateway\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.kun:kun-api-gateway:0.0.1-SNAPSHOT: Failure to find com.kun:kun-api:pom:0.0.1 in https://maven.aliyun.com/repository/public was cached in the local repository, resolution will not be reattempted until the update interval of aliyunmaven has elapsed or updates are forced and 'parent.relativePath' points at no local POM @ line 5, column 13 -> [Help 2]
[ERROR]   
[ERROR]   The project com.kun:kun-api-common:0.0.1 (D:\IdeaProjects\API\kun-api-master\kun-api-master\kun-api-common\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.kun:kun-api-common:0.0.1: Failure to find com.kun:kun-api:pom:0.0.1 in https://maven.aliyun.com/repository/public was cached in the local repository, resolution will not be reattempted until the update interval of aliyunmaven has elapsed or updates are forced and 'parent.relativePath' points at no local POM @ line 5, column 13 -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Process finished with exit code 1

试了各种方法,把父子模块之间的依赖关系去除,分别clean,发现common模块不依赖父模块单独clean时正常,依赖父模块clean报错;再次把父模块和其他子模块去除依赖关系,父模块单独clean正常。这就很奇怪了,然后又各种找问题。。。

解决

最后发现把<relativePath>删除,项目clean正常。

但是,当我package时,出现了新的错误。。。

看到这个报错,果断检查相关配置,同时检查jdk环境变量,都是配置没有问题的。

又折腾了半天,发现是maven编译打包插件配置有问题,把编译打包插件切换为这个,项目clean,package等操作恢复正常。

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>${spring-boot-dependencies.version}</version>
        </plugin>
    </plugins>
</build>
Logo

更多推荐