Yet another coffeescript maven plugin.
Love coffeescript. Love Maven. Wanna replace javascript at all.
Just play with your .coffee like what you did to .js before, and let me take care of the rest:
There are two maven plugins can compile coffeescript to javascript, as I know:
brew can do more than just compile coffeescript, but it's not up to date, see here.
coffee-maven-plugin works great, but it is short of some features.
Just add the plugin to your pom:
<build>
...
<plugins>
...
<plugin>
<groupId>com.github.iron9light</groupId>
<artifactId>coffeescript-maven-plugin</artifactId>
<version>1.1.2</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
The full pom configuration is here. Configuration options shown are default values and can be ignored for normal use.
<build>
<plugins>
<plugin>
<groupId>com.github.iron9light</groupId>
<artifactId>coffeescript-maven-plugin</artifactId>
<version>1.1.2</version>
<configuration>
<srcDir>${basedir}/src/main/webapp</srcDir>
<outputDir>${basedir}/src/main/webapp</outputDir>
<bare>false</bare>
<modifiedOnly>false</modifiedOnly>
<allowedDelete>true</allowedDelete>
<compilerUrl></compilerUrl>
</configuration>
<executions>
<execution>
<id>coffeescript</id>
<phase>generate-resources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
mvn coffeescript:compile
Compile coffeescript files to javascript files.
mvn coffeescript:watch
Compile coffeescript files to javascript files, and recompile as soon as a change occurs.
The Apache Software License, Version 2.0.