# brew
**Repository Path**: mirrors_fusesource/brew
## Basic Information
- **Project Name**: brew
- **Description**: Maven plugin for compiling coffeescript, haml-js and aggregating AMD-based js projects.
- **Primary Language**: Unknown
- **License**: LGPL-2.1
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-08
- **Last Updated**: 2026-02-28
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Brew maven plugin
Build javascript apps (optionally using coffeescript) using the CommonJS Asynchronous Module Definition (AMD)
pattern to define classes and dependencies between them. See:
http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition
Brew includes:
* The require.js "optimizer", which aggregates and minifies AMD-based projects
* The coffeescript compiler
* The haml-js compiler
### Purpose
Allow building modern javascript applications within organizations that are already invested in
maven-based build systems and surrounding architecture.
### Usage
Just add the plugin to your pom:
..
com.voltvoodoo
brew
0.2.1
compile
optimize
### Goal: compile
compile is by default attached to the "process-classes" phase.
compile will by default look for coffeescript files (\*.coffee) and haml files (\*.haml)
recursively in ${basedir}/src/main/coffeescript, and output the compiled js files
into ${project.build.outputDirectory}.
You can make the compile goal watch for changes and new coffeescript and haml files, and
recompile them on the fly. That way, you don't have to re-run your maven build over and over.
To watch for changes, either set "brew.watch" to true:
mvn brew:compile -Dbrew.watch=true
Or set the "watch" config property to true. Here are the config settings available for the
compile goal:
..
com.voltvoodoo
brew
0.1
compile
${basedir}/my/awesome/directory
${basedir}/src/main/webapp/js
${basedir}/my/awesome/directory
${basedir}/src/main/webapp/js
### Goal: optimize
Uses the require.js optimizer to aggregate and minify your project. Dependencies should be
defined using the CommonJS Asynchronous Module Definition pattern, see the require.js documentation.
The "optimize" goal is by default attached to the "process-classes" maven phase. It will go through
all the js modules you have listed in your plugin configuration, interpret the AMD dependencies
each file has, aggregate and minify that entire dependency tree, and put the resulting minified filed in
your output directory.
By default, optimize looks for a js file named "main.js" in
${project.build.outputDirectory}, and puts the resulting main.min.js aggregate
file in ${project.build.outputDirectory}.
The source and output directories can be set in your POM:
${basedir}/my/awesome/directory
${basedir}/target/somebuildfolder
${basedir}/somewhere
You can change the module name from the default ("main") by setting the
"module" config property. You can also provide a list of modules using the
"modules" config property, the modules setting overrides the module setting.
Minimum settings for the "modules" property would be:
..
myapp
..
Brew supports almost all settings that the require.js optimization
tool does. Unfortunately, I haven't had time to document them properely.
Until they are, please refer to the java-doc in com.voltvoodoo.brew.OptimizeMojo
and in com.voltvoodoo.brew.Module