Maven 2可以在同一项目中使用构建插件的两个不同版本吗? [英] Can Maven 2 use two different versions of a build plugin in the same project?

查看:262
本文介绍了Maven 2可以在同一项目中使用构建插件的两个不同版本吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目需要某些目标的新版本的Maven构建插件的功能,但新版本由于另一个目标之一而失败(由于插件中的错误).作为解决该错误之前的一种解决方法,我想使用较旧版本的插件来运行目标. 更具体地说,我需要使用gwt-maven-plugin 1.1版本运行generateAsync目标,并使用1.2-SNAPSHOT版本运行所有其他目标.

My project requires features of a new version of a maven build plugin for some of its goals, but the new version fails (due to a bug in the plugin) on one of the other goals. As a workaround until the bug is fixed, I'd like to run the broken goal with an older version of the plugin. More specifically, I need to run the generateAsync goal with version 1.1 of the gwt-maven-plugin and all other goals with version 1.2-SNAPSHOT.

当我声明一个单独的插件版本来执行中断的目标时,Maven仍会使用中断的版本. 还有另一种解决此问题的方法吗?

When I declare a separate plugin version to execute the broken goal, Maven still uses the broken version. Is there another way to solve this problem?

<plugin>
 <groupId>org.codehaus.mojo</groupId>
 <artifactId>gwt-maven-plugin</artifactId>
 <version>1.1</version>
   <executions>
     <execution>
       <goals>
         <!-- this goal is broken in 1.2-SNAPSHOT -->
         <goal>generateAsync</goal>
       </goals>
     </execution>
   </executions>
   ...
 </plugin>
 <plugin>
   <groupId>org.codehaus.mojo</groupId>
   <artifactId>gwt-maven-plugin</artifactId>
   <version>1.2-SNAPSHOT</version>
   <executions>
     <execution>
       <goals>
         <goal>compile</goal>
         <!-- <goal>generateAsync</goal> -->
         <goal>test</goal>
       </goals>
     </execution>
   </executions>
   ...
</plugin>

推荐答案

您必须在您的POM中两次声明相同的插件.可以将一个<plugin>块与两个<executions>一起使用,但这不能解决您的问题,因此,,无法实现您想要的目标.

You must not declare the same plugin twice in your POM. What is possible is to use one <plugin> block with two <executions> but this won't solve your issue so, no, there is no way to achieve what you want.

但是您是否测试了gwt-maven-plugin 1.2发行候选版?它已在今天 http://people.apache.org/~nicolas/staging/上提供. ,投票时间为72小时,欢迎进行测试.也许您的问题在此版本中得到了解决(但是不确定,因为您没有提供太多有关该问题的详细信息,而且我也没有在gwt:generateAsync相关的任何问题. codehaus.org/browse/MGWT"rel =" nofollow noreferrer>最近关闭或打开的插件的问题跟踪器.

But did you test the gwt-maven-plugin 1.2 release candidate? It has been made available today here http://people.apache.org/~nicolas/staging/, vote is open for 72h and tests are welcome. Maybe your issue is solved in this version (not sure though as you didn't give much details on the problem and as I didn't find any issue related to gwt:generateAsync in the issue tracker of the plugin that has been recently closed or opened).

如果您有问题跟踪器中未列出的特定问题,则似乎是是使人们意识到它的最佳时机,尤其是如果您希望在1.2版中解决它.球在你的球场上.

If you have a particular problem not listed in the issue tracker, it seems to be the perfect time to make people aware of it, especially if you want it solved in version 1.2. The ball is in your court.

这篇关于Maven 2可以在同一项目中使用构建插件的两个不同版本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆