Skip to content
This repository has been archived by the owner on Jan 9, 2019. It is now read-only.

Disable auto compilation #71

Open
harishasan opened this issue Jan 7, 2015 · 1 comment
Open

Disable auto compilation #71

harishasan opened this issue Jan 7, 2015 · 1 comment

Comments

@harishasan
Copy link

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>
@agabrys
Copy link

agabrys commented Sep 17, 2015

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>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants