最近,我遇到了以下问题:
当我为我的项目设置依赖项管理时,我有使用带有依赖项的插件的子 pom,我希望与我的依赖项管理中声明的依赖项同步。
在根 pom 中,我在依赖项管理中声明:
<dependencyManagement>
<dependencies>
...
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.4.0</version>
</dependency>
...
<dependencies>
<dependencyManagement>
在子 pom 中,我有一个需要 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>
但是,如果我删除 gwt-maven-plugin 中使用的依赖版本,编译将失败。
还有其他方法可以实现吗?
PS:有一个相关的帖子在 maven 和 maven 插件中选择依赖版本没有回答我的问题