Question

I have a POM that describes a set of dependencies in it's dependencyManagement section. This set of dependencies defines what dependencies will be provided when I deploy my application so I want to stick to this list and not have my project redefine them.

Is there a way that I can inherit the managed dependencies from this POM without it being the parent POM of my project?

I would like to avoid specifying versions etc in my project POM.

Was it helpful?

Solution

I think you're looking for something like:

 <dependencyManagement>
   <dependencies>
     ...
     <dependency>
       <groupId>someGroupId</groupId>
       <artifactId>someArtifactId</artifactId>
       <version>someVersion</version>
       <type>pom</type>
       <scope>import</scope>
     </dependency> 
     ...
   </dependencies>
 </dependencyManagement>

You could define this e.g. in your parent POM.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top