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