lesscss-maven-plugin icon indicating copy to clipboard operation
lesscss-maven-plugin copied to clipboard

Disable auto compilation

Open harishasan opened this issue 10 years ago • 1 comments

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>
    </execution>
  </executions>
</plugin>

harishasan avatar Jan 07 '15 14:01 harishasan

M2Eclipse is an Eclipse plugin which provides tight integration for Maven. It determines who and when plugins should be executed. Each plugin can store lifecycle mapping metadata with data on which it based its decision (see M2E compatible maven plugins). By default this plugin is called on incremental builds:

<lifecycleMappingMetadata>
    <pluginExecutions>
        <pluginExecution>
            <pluginExecutionFilter>
                <goals>
                    <goal>compile</goal>
                </goals>
            </pluginExecutionFilter>
            <action>
                <execute>
                    <runOnIncremental>true</runOnIncremental>
                    <runOnConfiguration>false</runOnConfiguration>
                </execute>
            </action>
        </pluginExecution>
    </pluginExecutions>
</lifecycleMappingMetadata>

If you want to disable automatic compilation, then you need to add the following entry to your pom.xml:

<pluginManagement>
   <plugins>
      <plugin>
         <groupId>org.eclipse.m2e</groupId>
         <artifactId>lifecycle-mapping</artifactId>
         <version>1.0.0</version>
         <configuration>
            <lifecycleMappingMetadata>
               <pluginExecutions>
                  <pluginExecution>
                     <pluginExecutionFilter>
                        <groupId>org.lesscss</groupId>
                        <artifactId>lesscss-maven-plugin</artifactId>
                        <versionRange>[0,)</versionRange>
                        <goals>
                           <goal>compile</goal>
                        </goals>
                     </pluginExecutionFilter>
                     <action>
                        <ignore />
                     </action>
                  </pluginExecution>
               </pluginExecutions>
            </lifecycleMappingMetadata>
         </configuration>
      </plugin>
   </plugins>
</pluginManagement>

agabrys avatar Sep 17 '15 19:09 agabrys