Answer the question
In order to leave comments, you need to log in
How to do a pom.xml setup with multiple "parents"?
Hello!
Tell me a beautiful solution for such a problem.
There is a common
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>ru.zeratustra</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>srv</module>
<module>sdk</module>
</modules>
</project>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>ru.zeratustra</groupId>
<artifactId>sdk</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>ru.zeratustra.sdk</name>
<description>Service SDK module</description>
<properties>....</properties>
<dependencies>....</dependencies>
<build>
<plugins>....</plugins>
</build>
</project>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>ru.zeratustra</groupId>
<artifactId>srv</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>ru.zeratustra.srv</name>
<description>Service module</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
<relativePath/>
</parent>
<properties>....</properties>
<dependencies>....</dependencies>
<build>
<plugins>....</plugins>
</build>
</project>
Answer the question
In order to leave comments, you need to log in
You can try with bom
Not the easiest solution, but I can't think of another:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>ru.zeratustra</groupId>
<artifactId>bom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>ru.zeratustra</groupId>
<artifactId>parent1</artifactId>
<scope>import</scope>
<version>${parent1.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>ru.zeratustra</groupId>
<artifactId>parent2</artifactId>
<scope>import</scope>
<version>${parent2.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question