I have a parent POM file and four child POM files. The child modules can't resolve the relativePath
../pom.xml
.
Error: Error
Project structure: Project structure
man clean install -X: mvn clean install -X
ParentPom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven 4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>filler</groupId>
<artifactId>filler</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>filler</name>
<packaging>pom</packaging>
<modules>
<module>account-service</module>
<module>lottery-ticket-service</module>
<module>lottery-service</module>
<module>service-registry</module>
</modules>
ChildPom/lottery-ticket-service:
<parent>
<groupId>filler</groupId>
<artifactId>filler</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>lottery-ticket-service</artifactId
<version>0.0.1-SNAPSHOT</version>
<properties>
<java.version>13</java.version>
</properties>
ChildPom/lottery-service:
<parent>
<groupId>filler</groupId>
<artifactId>filler</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>lottery-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<java.version>13</java.version>
</properties>
ChildPom/service-registry:
<parent>
<groupId>filler</groupId>
<artifactId>filler</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>service-registry</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<java.version>13</java.version>
</properties>
ChildPom/account-service:
<parent>
<groupId>filler</groupId>
<artifactId>filler</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>account-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<java.version>13</java.version>
</properties>
Remove this tag from child pom.xml by default it will search in parent dir
<relativePath>../pom.xml</relativePath>