JorgeGRC JorgeGRC - 8 months ago 56
Less Question

How to compile LESS into CSS when files are saved in Eclipse

I'm developing a

struts2 webapp
for months now using maven to manage my dependencies and I've just discovered
. I have installed and configured the
LESS plug-in for Eclipse
but it's really annoying to
right click > run as > LESS compiler
every time I save the .less file due to a modification of its content or something...

The thing is that I've been researching on how to plug in
(recently discovered task runners too) into maven (as explained here) but I think it's quite hard and I wondered if somebody knew an alternative to this.

In my
project I have both the front and back-end of my webapp.I know it's not the right approach and if I could start all over again I would separate them into two different projects, but now it's too late (disadvantages of the learning proccess, we're not born knowing it all).

Having said all this, how can I set up a kind of task for watching my
files and automatically compile them into
when saved/changed?

I also found this ant task here, but I dont really know if it's what I'm looking for.


There are a lot of Java Less compiler (see Java Compiler for Less CSS?), so you can execute one of them by your build tool (e.g. Ant - maybe you need to write a simple Java application, which use the chosen compiler).

If you use Maven (or can switch to it) to project management, then you can use one of lesscss-maven-plugin: