Maven插件 [WARNING] 'parent.relativePath' of POM 类似警告处理

本文详细解析在Eclipse中使用Maven进行父子工程配置的过程,包括如何通过Maven安装父工程生成jar包并存入本地仓库,以及解决子工程依赖问题的方法。文章还介绍了<relativePath>标签的作用及其在构建过程中的重要性。
部署运行你感兴趣的模型镜像

前提交代:在Eclipse中,本人在Maven工程中已经做好了父工程,其他工程均继承于此工程,子工程中的pom文件均设置了一个父节点<parent>

依赖于父工程,但是现在没有jar包可以依赖,所以

第一步:先Maven install 父工程,将它打成jar包 放在本地仓库中;

第二步:开始 运行Maven插件,clean tomcat7:run

结果就报错了,如下图1:

 

而之后添加<relativePath>之后,结果如图2:

 

没有报错或者警告,运行正常,分析原因如下:

虽然父工程已经打包成jar包,并且存入本地仓库,但是没有有效的路径指向这个父工程的jar包,所有有警告。

添加<relativePath>标签(该标签的作用是:父工程的pom.xml文件的相对路径,相对路径允许你选择一个不同的路径),如过没有给标签加添具体地址,则即为默认地址,默认值为:../pom.xml。Maven首先在构建当前项目的地方需找父工程的pom,其次在文件系统的这个位置(relativePath位置),绕后是在本地仓库,最后在远程仓库寻找父工程的pom。

 

推荐这个博客,Maven介绍很全,如我般新手肯定有大帮助的,https://blog.youkuaiyun.com/yaerfeng/article/details/26448417     

如果有什么不正确的地方请速速支出,共同进步。

 

 

您可能感兴趣的与本文相关的镜像

Qwen-Image

Qwen-Image

图片生成
Qwen

Qwen-Image是阿里云通义千问团队于2025年8月发布的亿参数图像生成基础模型,其最大亮点是强大的复杂文本渲染和精确图像编辑能力,能够生成包含多行、段落级中英文文本的高保真图像

C:\Users\28122\.jdks\corretto-1.8.0_362\bin\java.exe -Dmaven.multiModuleProjectDirectory=D:\czt\picc_project\tfs\server\piccxzpt\piccxzpt_base_service -Djansi.passthrough=true -Dmaven.home=D:\apache-maven-3.6.3 -Dclassworlds.conf=D:\apache-maven-3.6.3\bin\m2.conf "-Dmaven.ext.class.path=D:\czt\IntelliJ IDEA 2022.3.2\plugins\maven\lib\maven-event-listener.jar" "-javaagent:D:\czt\IntelliJ IDEA 2022.3.2\lib\idea_rt.jar=58743:D:\czt\IntelliJ IDEA 2022.3.2\bin" -Dfile.encoding=UTF-8 -classpath D:\apache-maven-3.6.3\boot\plexus-classworlds-2.6.0.jar;D:\apache-maven-3.6.3\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2022.3.2 -s D:\apache-maven-3.6.3\conf\settings.xml -DskipTests=true clean [INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework.boot:spring-boot-starter-cache:jar -> duplicate declaration of version (?) @ line 402, column 21 [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.poi:poi:jar -> version 4.1.1 vs 4.1.2 @ line 413, column 21 [WARNING] 'parent.relativePath' of POM com.picc.xzpt.base:piccxzpt_base_service:0.0.1 (D:\czt\picc_project\tfs\server\piccxzpt\piccxzpt_base_service\pom.xml) points at com.picc.xzpt:piccxzpt instead of pdfc:pdfc-parent, please verify your project structure @ line 14, column 13 [FATAL] Non-resolvable parent POM for com.picc.xzpt.base:piccxzpt_base_service:0.0.1: Failure to find pdfc:pdfc-parent:pom:4.2.8.4 in http://10.25.45.75:8082/repository/maven-public/ was cached in the local repository, resolution will not be reattempted until the update interval of public has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 14, column 13 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project com.picc.xzpt.base:piccxzpt_base_service:0.0.1 (D:\czt\picc_project\tfs\server\piccxzpt\piccxzpt_base_service\pom.xml) has 1 error [ERROR] Non-resolvable parent POM for com.picc.xzpt.base:piccxzpt_base_service:0.0.1: Failure to find pdfc:pdfc-parent:pom:4.2.8.4 in http://10.25.45.75:8082/repository/maven-public/ was cached in the local repository, resolution will not be reattempted until the update interval of public has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 14, 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 清除 报异常
最新发布
11-22
显示[INFO] Scanning for projects... Downloading from central: https://repo.maven.apache.org/maven2/com/tro/tro/3.3/tro-3.3.pom [ERROR] [ERROR] Some problems were encountered while processing the POMs: [WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.springframework.boot:spring-boot-maven-plugin @ line 252, column 21 [FATAL] Non-resolvable parent POM for com.tro:pfep:1.0-SNAPSHOT: Could not transfer artifact com.tro:tro:pom:3.3 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [public (http://192.168.1.88:8081/nexus/content/groups/public/, default, releases+snapshots)] and 'parent.relativePath' points at wrong local POM @ line 5, column 13 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project com.tro:pfep:1.0-SNAPSHOT (C:\Users\trotter\Desktop\PFEP\pom.xml) has 1 error [ERROR] Non-resolvable parent POM for com.tro:pfep:1.0-SNAPSHOT: Could not transfer artifact com.tro:tro:pom:3.3 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [public (http://192.168.1.88:8081/nexus/content/groups/public/, default, releases+snapshots)] and 'parent.relativePath' points at wrong 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
09-29
[root@centos ~]# cd wvp-GB28181-pro/ [root@centos wvp-GB28181-pro]# ls aliyun.crt bin bootstrap.sh buildPackage.sh doc docker install.sh libs LICENSE pom.xml README.md run.sh src web zlm.md 打包 数据库 [root@centos wvp-GB28181-pro]# mvn package [INFO] Scanning for projects... Downloading from nexus-aliyun: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-starter-parent/2.7.18/spring-boot-starter-parent-2.7.18.pom Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.7.18/spring-boot-starter-parent-2.7.18.pom [ERROR] [ERROR] Some problems were encountered while processing the POMs: [WARNING] 'dependencies.dependency.systemPath' for com.kingbase:kingbase8:jar should not point at files within the project directory, ${basedir}/libs/jdbc-aarch/kingbase8-8.6.0.jar will be unresolvable by dependent projects @ line 173, column 16 [WARNING] 'dependencies.dependency.systemPath' for com.kingbase:kingbase8:jar should not point at files within the project directory, ${basedir}/libs/jdbc-x86/kingbase8-8.6.0.jar will be unresolvable by dependent projects @ line 180, column 16 [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.kingbase:kingbase8:jar -> duplicate declaration of version 8.6.0 @ line 175, column 15 [FATAL] Non-resolvable parent POM for com.genersoft:wvp-pro:2.7.4: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.7.18 from/to nexus-aliyun (https://maven.aliyun.com/repository/public): transfer failed for https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-starter-parent/2.7.18/spring-boot-starter-parent-2.7.18.pom and 'parent.relativePath' points at wrong local POM @ line 6, column 13 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project com.genersoft:wvp-pro:2.7.4 (/root/wvp-GB28181-pro/pom.xml) has 1 error [ERROR] Non-resolvable parent POM for com.genersoft:wvp-pro:2.7.4: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.7.18 from/to nexus-aliyun (https://maven.aliyun.com/repository/public): transfer failed for https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-starter-parent/2.7.18/spring-boot-starter-parent-2.7.18.pom and 'parent.relativePath' points at wrong local POM @ line 6, column 13: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [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 [root@centos wvp-GB28181-pro]# 报错怎么解决
07-03
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release [INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] Non-resolvable parent POM for com.google.zxing:android:4.7.4: Could not find artifact com.google.zxing:zxing-parent:pom:3.2.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 39, column 11 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project com.google.zxing:android:4.7.4 (/home/yangxf/ESL_Android_Client/ZXing_android_3.2/pom.xml) has 1 error [ERROR] Non-resolvable parent POM for com.google.zxing:android:4.7.4: Could not find artifact com.google.zxing:zxing-parent:pom:3.2.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 39, column 11 -> [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 分析一下报错原因
07-10
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值