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

Using lesscss-maven-plugin in Eclipse (with m2e)

Open DenisGL opened this issue 12 years ago • 5 comments

Hello, I've tried to use your (wonderfull) plugin from within Eclipse (with m2e), but nothing happens : no css file is generated. Could you provide a kind of how-to for using this plugin in Eclipse ? Thanks a lot.

DenisGL avatar Jul 20 '12 20:07 DenisGL

Here are the relevant portions of my pom.xml:

<project>
    <properties>
        <lesscss.outputDirectory>${project.build.directory}/${project.build.finalName}/styles</lesscss.outputDirectory>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.lesscss</groupId>
                <artifactId>lesscss-maven-plugin</artifactId>
                <version>1.3.3</version>
                <configuration>
                    <sourceDirectory>${project.basedir}/src/main/webapp/styles</sourceDirectory>
                    <outputDirectory>${lesscss.outputDirectory}</outputDirectory>
                    <compress>true</compress>
                    <includes>
                        <include>all.less</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>m2e</id>
            <activation>
                <property>
                    <name>m2e.version</name>
                </property>
            </activation>
            <properties>
                <lesscss.outputDirectory>${project.build.directory}/m2e-wtp/web-resources/styles</lesscss.outputDirectory>
            </properties>
        </profile>
    </profiles>
</project>

Aldaviva avatar Jun 06 '13 02:06 Aldaviva

Thanks Aldaviva !

jeromevdl avatar Dec 10 '13 14:12 jeromevdl

Hi i tried this, but when cleaning my project the less file is not compiled to m2e-wtp\web-resources\resources\css until i change anything in my .less file

i'm using eclipse neo

wutzebaer avatar Oct 17 '16 12:10 wutzebaer

Maybe changing the plugin execution phase from process-sources to a different phase would help?

Aldaviva avatar Oct 17 '16 12:10 Aldaviva

Hm did not help, it seams that the compile goal is not called at all when i change the "sourceDirectory" do anything invalid i get an error in my pom.xml, but after a clean the error diappears... but this source tells that compile should beexecuted: http://stackoverflow.com/questions/2632425/how-do-i-start-maven-compile-goal-on-save-in-eclipse#2633133 when saving the pom or my less file againt the arror re-appears

wutzebaer avatar Oct 17 '16 12:10 wutzebaer