Recently, I came accross the following problem :
As I set up dependency management for my project, I had child-pom using plugin with dependencies, that I want to be synchronized with dependencies declared in my dependency management.
In a root pom, I declared in my dependency management:
<dependencyManagement> <dependencies> ... <dependency> <groupId>com.google.gwt</groupId> <artifactId>gwt-user</artifactId> <version>2.4.0</version> </dependency> ... <dependencies> <dependencyManagement> And in the child pom, I have a plugin which needs gwt-user :
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>2.4.0</version> <dependencies> <dependency> <groupId>com.google.gwt</groupId> <artifactId>gwt-user</artifactId> <version>2.4.0</version> </dependency> ... </dependencies> ... </plugin> However, if I remove the dependency version used in gwt-maven-plugin, the compilation fails.
Is there another way to achieve it ?
PS: There is a related post Choosing dependency version in maven and maven plugin which does not answer my question