org.nanoko.coffee.mill.mojos.others
Class WatchMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nanoko.coffee.mill.mojos.AbstractCoffeeMillMojo
org.nanoko.coffee.mill.mojos.others.WatchMojo
- All Implemented Interfaces:
- org.apache.commons.vfs2.FileListener, org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
public class WatchMojo
- extends AbstractCoffeeMillMojo
- implements org.apache.commons.vfs2.FileListener
This mojo watches the file change in the source directories and process them automatically.
To work correctly, launch mvn clean test first. This will resolve and prepare all required file.
Then mvn org.nanoko.coffee-mill:coffee-mill-maven-plugin:watch will starts the watch mode.
This mojo supports reactor mode, i.e. is able to watch several modules and updates files. To enable this mode,
launch the watch mode with -Dwatched.project=artifactId of the final project. This will watch all
resources of all the modules of the reactor and copy the resulting artifact on the other module in the specified
project.
You can configure the watched port with the -Dwatch.port=8234 option. By default the used port is 8234.
| Fields inherited from class org.nanoko.coffee.mill.mojos.AbstractCoffeeMillMojo |
assetsDir, baseDirectory, buildDirectory, coffeeScriptDir, coffeeScriptTestDir, javaScriptDir, javaScriptTestDir, libDir, project, projectHelper, stylesheetsDir, workDir, workTestDir |
| Fields inherited from interface org.apache.maven.plugin.Mojo |
ROLE |
|
Method Summary |
void |
execute()
|
void |
fileChanged(org.apache.commons.vfs2.FileChangeEvent event)
|
void |
fileCreated(org.apache.commons.vfs2.FileChangeEvent event)
|
void |
fileDeleted(org.apache.commons.vfs2.FileChangeEvent event)
|
| Methods inherited from class org.apache.maven.plugin.AbstractMojo |
getLog, getPluginContext, setLog, setPluginContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
session
protected org.apache.maven.execution.MavenSession session
- The maven session.
reactorProjects
protected List<org.apache.maven.project.MavenProject> reactorProjects
- Contains the full list of projects in the reactor.
watchCoffeeScript
protected boolean watchCoffeeScript
watchLess
protected boolean watchLess
watchDust
protected boolean watchDust
watchDoAggregate
protected boolean watchDoAggregate
watchValidateJS
protected boolean watchValidateJS
watchValidateCSS
protected boolean watchValidateCSS
watchOptimizeAssets
protected boolean watchOptimizeAssets
- Enables the PNG and JPEG optimization
watchRunServer
protected boolean watchRunServer
watchJettyServerPort
protected int watchJettyServerPort
watchedProject
protected String watchedProject
cssAggregation
protected List<String> cssAggregation
server
protected org.eclipse.jetty.server.Server server
- The Jetty Server
processors
protected List<Processor> processors
- The processors
optiPngOptimizationLevel
protected int optiPngOptimizationLevel
WatchMojo
public WatchMojo()
execute
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
- Specified by:
execute in interface org.apache.maven.plugin.Mojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
fileCreated
public void fileCreated(org.apache.commons.vfs2.FileChangeEvent event)
throws Exception
- Specified by:
fileCreated in interface org.apache.commons.vfs2.FileListener
- Throws:
Exception
fileDeleted
public void fileDeleted(org.apache.commons.vfs2.FileChangeEvent event)
throws Exception
- Specified by:
fileDeleted in interface org.apache.commons.vfs2.FileListener
- Throws:
Exception
fileChanged
public void fileChanged(org.apache.commons.vfs2.FileChangeEvent event)
throws Exception
- Specified by:
fileChanged in interface org.apache.commons.vfs2.FileListener
- Throws:
Exception
Copyright © 2012-2013 OW2. All Rights Reserved.