iron9light / coffeescript-maven-plugin

A Maven plugin for compiling coffeescript into javascript.
35 stars 9 forks source link

Coffeescript Maven Plugin

Yet another coffeescript maven plugin.

Purpose

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:

Why another coffeescript maven plugin?

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.

Requires

Usage

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>

Goal:compile

mvn coffeescript:compile

Description:

Compile coffeescript files to javascript files.

Attributes:

Optional Parameters:

Goal:watch

mvn coffeescript:watch

Description:

Compile coffeescript files to javascript files, and recompile as soon as a change occurs.

Attributes:

Optional Parameters:

License

The Apache Software License, Version 2.0.

Acknowledgement