eclipse - Compiling LESS CSS with Maven and m2e-wtp -
i'm trying compile less css files lesscss-maven-plugin, both in pure maven (with command line) , within eclipse (juno).
in lesscss-maven-plugin, need define output directory, noticed in eclipse wtp copies files target/m2e-wtp
in server (jboss), directory ignored war plugin of maven.
i succeeded reach goal maven profiles : in eclipse use m2e
profile configured in project settings, can define 2 different destination folders depending on build in eclipse or not.
here pom.xml :
<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.dgadev.motd</groupid> <artifactid>motd</artifactid> <version>0.0.1-snapshot</version> <packaging>war</packaging> <properties> <maven.compiler.source>7</maven.compiler.source> <maven.compiler.target>7</maven.compiler.target> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties> <dependencies> .... </dependencies> <build> <plugins> <plugin> <groupid>org.lesscss</groupid> <artifactid>lesscss-maven-plugin</artifactid> <version>1.3.3</version> <configuration> <outputdirectory>${project.build.directory}/resources/css</outputdirectory> </configuration> <executions> <execution> <goals> <goal>compile</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <profiles> <profile> <id>m2e</id> <build> <plugins> <plugin> <groupid>org.lesscss</groupid> <artifactid>lesscss-maven-plugin</artifactid> <version>1.3.3</version> <configuration> <outputdirectory>${project.build.directory}/m2e-wtp/web-resources/resources/css</outputdirectory> </configuration> <executions> <execution> <goals> <goal>compile</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles>
this works, there better way this, without profile trick ?
i found solution different less compiler : wro4j. compiler, both exists maven , m2e plugins. in addition, tutorial (for building boostrap) can found here: m2e-wro4j
Comments
Post a Comment