天天看點

[Maven] 打包報錯Non-resolvable parent POM for

D:\projects-my\spring-cloud-alibaba-fb-practical\user-dao\user-dao-apis>mvn clean package install

[INFO] Scanning for projects...

[ERROR] [ERROR] Some problems were encountered while processing the POMs:

[FATAL] Non-resolvable parent POM for com.fanbo:user-dao:1.0-SNAPSHOT: Could not find artifact com.fanbo:parent-pom-dao:pom:1.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ com.fanbo:user-dao:1.0-SNAPSHOT, D:\projects-my\spring-cloud-alibaba-fb-practical\user-dao\pom.xml, line 7, column 13

@

[ERROR] The build could not read 1 project -> [Help 1]

[ERROR]

[ERROR] The project com.fanbo:user-dao-apis:1.0-SNAPSHOT (D:\projects-my\spring-cloud-alibaba-fb-practical\user-dao\user-dao-apis\pom.xml) has 1 error

[ERROR] Non-resolvable parent POM for com.fanbo:user-dao:1.0-SNAPSHOT: Could not find artifact com.fanbo:parent-pom-dao:pom:1.0-SNAPSHOT and 'parent.relativePath' points at no local POM @ com.fanbo:user-dao:1.0-SNAPSHOT, D:\projects-my\spring-cloud-alibaba-fb-practical\user-dao\pom.xml, line 7, 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

解決:

将各個服務的子父級pom依賴關系,加上相對路徑屬性,如:

<parent>

<artifactId>parent-pom-service</artifactId>

<groupId>com.fanbo</groupId>

<version>1.0-SNAPSHOT</version>

<relativePath>../parent-pom/parent-pom-service/pom.xml</relativePath>

</parent>