I would like to import properties from a project X pom file into my project Y pom such as library versions. I do not want to make the project X my project's parent.
I have tried to include project Xs pom in the dependency management section as an import.
<dependency>
<groupId>abc</groupId>
<artifactId>def</artifactId>
<version>1.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Please advise. Thanks.
The usual approach to share dependency versions without using parent POMs are BOMs.
These are separate projects that only contain a pom.xml
which consists of <dependencyManagement>
. This can then be imported in several other projects with <scope>import</scope>
.
These other projects then import the dependencyManagement inside the BOM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With