报错信息:
Some problems were encountered while processing the POMs:
[WARNING] 'parent.relativePath' points at com.taotao.www:taotao instead of com.taotao.parent:taotao-parent, please verify your project structure @ line 7, column 13 [FATAL] Non-resolvable parent POM: Could not transfer artifact com.taotao.parent:taotao-parent:pom:1.0-SNAPSHOT from/to chinaweal-nexus (http://172.2.xx.xxx:8081/nexus/content/groups/public/): Connect to 172.xx.xx.xx:8081 [/172.xx.xx.154] failed: Connection refused: connect and 'parent.relativePath' points at wrong local POM @ line 7, column 13 more... (Ctrl+F1)
项目的结构:
开始我以为是无法连接到仓库的问题,后面发现实际是idea的依赖关系的混乱导致的错误,我们需要将父类的pom文件地址给其指定,如下
添加 <relativePath></relativePath> 这个元素并指定pom文件路径(父类),这样就可以解决报错,另外我们需要注意依赖关系,不能指定多个父类,写完后可以点击一下pom文件看是否到指定的文件位置