MAVEN打包的`parent.relativePath points at wrong local POM`问题

在idea中,利用maven插件时,对于多个maven子项目第一次打包(clear或者install)报错 parent.relativePath points at wrong local POM

经过一番百度操作,发现有两种解决方法,记录一下

1.   可先将下面的模块(modules)注释掉,再进行打包,打包完成后,放开注释,重新打包,就不会报错

(或者把父级pom文件直接拷贝到项目打包路径下也可以(如下代码的com/app/app-interf/1.0-SNAPSHOT目录下))

一些代码

   父pom文件

 
  <
modelVersion>4.0.0modelVersion> <groupId>com.appgroupId> <artifactId>app-interfartifactId> <version>1.0-SNAPSHOTversion> <packaging>pompackaging> <properties> <project.build.sourceEncoding>UTF-8project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8project.reporting.outputEncoding> <java.version>1.8java.version> properties> <parent> <groupId>org.springframework.bootgroupId> <artifactId>spring-boot-starter-parentartifactId> <version>2.1.4.RELEASEversion> <relativePath/> parent> <developers> <developer> developer> developers> <modules> <module>jdbcmodule> <module>utilmodule> <module>commonmodule> modules>

  子pom文件

    <modelVersion>4.0.0modelVersion>
    <packaging>jarpackaging>
    <groupId>com.app.jdbcgroupId>
    <artifactId>jdbcartifactId>
    <version>1.0-SNAPSHOTversion>

     <parent>
        <artifactId>app-interfartifactId>
        <groupId>com.appgroupId>
        <version>1.0-SNAPSHOTversion>
        <relativePath/>
    parent>

 

 

2.  在子pom文件中,配置属性

  

    <modelVersion>4.0.0modelVersion>
    <packaging>jarpackaging>
    <groupId>com.app.jdbcgroupId>
    <artifactId>jdbcartifactId>
    <version>1.0-SNAPSHOTversion>

     <parent>
        <artifactId>app-interfartifactId>
        <groupId>com.appgroupId>
        <version>1.0-SNAPSHOTversion>
        <relativePath>../pom.xmlrelativePath>
    parent>

 

转载于:https://www.cnblogs.com/yuan1994/p/11180098.html

你可能感兴趣的:(MAVEN打包的`parent.relativePath points at wrong local POM`问题)