Maven插件执行顺序

Maven插件执行顺序

本文介绍了Maven插件执行顺序,但不包括js文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了pom.xml,以便首先组合项目中的所有js文件,然后压缩JS文件.这两个步骤是两个插件,并且处于编译阶段.

I have developed the pom.xml to first combine all the js files in the project and then compress the JS file. These 2 steps are two plugin and are in compile phase.

但是puglin执行顺序被颠倒了几次,构建失败了.如果有人看到此问题,请重定向至解决方案.

But some how few times puglin execution order is reversed and build fails. In case some one has seen this issue please redirect me to solution.

第二,我不将JS合并和压缩到.war中.

Secondly, I don't to include the JS in .war which are combined and compressed.

推荐答案

要严格回答问题的第一部分,绑定到同一阶段的插件应按照与POM和其他任何行为都应视为但是"(请参见 MNG-2258 ).但是我个人获得了Maven 2.2.1的预期行为.

To strictly answer the first part of the question, plugins bound to the same phase are supposed to be executed in the same order as they are listed in the POM and any other behavior should be considered as a but (see MNG-2258). But I personally get the expected behavior with Maven 2.2.1.

如果没有更多细节,回答问题的第二部分将变得更加困难:

Answering the second part of the question will be harder without more details:

  • 您的项目的结构是什么?
  • 初始文件在哪里?
  • 您正在使用或做什么(您正在使用 YIU Compressor 是上一个问题?)?
    • 如果是,您是否知道它可以处理 aggregations (因此无需执行两次)
    • what is the structure of your project?
    • where are the initial files located?
    • what are you using or doing (are you using the YIU Compressor of the previous question?)?
      • if yes, do you know that it can deal with aggregations (and thus remove the need for two executions)

      换句话说,请提供更多信息.

      In other words, give more info please.

      这篇关于Maven插件执行顺序,但不包括js文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 18:45