禁用LESS的自动编译 [英] Disable auto compilation of LESS

查看:107
本文介绍了禁用LESS的自动编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse环境中。我希望LESS仅在通过mvn包显式调用时进行编译。目前,一旦我对我的文件进行了任何更改,它会将更改传播给CSS。我应该如何避免这种情况?

 < plugin> 
< groupId> org.lesscss< / groupId>
< artifactId> lesscss-maven-plugin< / artifactId>
< version> 1.7.0.1.1< / version>
< configuration>
< watch> false< / watch>
< sourceDirectory> src / main / webapp / css< / sourceDirectory>
< outputDirectory> src / main / webapp / css< / outputDirectory>
< compress> true< / compress>
< force> true< / force>
< / configuration>
<执行>
< execution>
< goals>
< goal> compile< / goal>
< / goals>
< phase> package< / phase>
< / execution>
< / executions>
< / plugin>

还发布了这个问题 here

解决方案

你需要定义哪个要执行插件的 maven阶段,基本上添加在执行标签下的阶段标签。请查看以下示例: http://maven.apache。 org / guides / mini / guide-configuration-plugins.html#Using_the_executions_Tag


I am in Eclipse environment. I want LESS to compile only when explicitly invoked via mvn package. At the moment, as soon as I make any changes in my less file it propagates the change to CSS. What should I do to avoid this behaviour?

<plugin>
  <groupId>org.lesscss</groupId>
  <artifactId>lesscss-maven-plugin</artifactId>
  <version>1.7.0.1.1</version>
  <configuration>
    <watch>false</watch>
    <sourceDirectory>src/main/webapp/css</sourceDirectory>
    <outputDirectory>src/main/webapp/css</outputDirectory>
    <compress>true</compress>
    <force>true</force>
    </configuration>
  <executions>
    <execution>
      <goals>
        <goal>compile</goal>
      </goals>
      <phase>package</phase>
    </execution>
  </executions>
</plugin>

also posted this issue here

解决方案

You need to define in which maven phase you want to execute your plugin, basically adding the phase tag under the execution tag. Take look to the following examples: http://maven.apache.org/guides/mini/guide-configuring-plugins.html#Using_the_executions_Tag.

这篇关于禁用LESS的自动编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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