近日,笔者来到翻过以下问题:Maven的依赖管理的插件依赖性
当我设置的依赖管理我的项目,我使用的插件与依赖,我想与依赖同步有孩子,聚甲醛在我的依赖管理中声明。
在根POM,我在我的依赖管理声明:
<dependencyManagement>
<dependencies>
...
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.4.0</version>
</dependency>
...
<dependencies>
<dependencyManagement>
而且在孩子POM,我有需要GWT-用户插件:
<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:有一个相关的帖子Choosing dependency version in maven and maven plugin不回答我的问题
恕我直言,如果只需要插件中的依赖关系,那么对于未来的引用,依赖关系管理部分 –
就没有用处。 pluginManagement在构建标签下 – TecHunter