package com.byclosure.maven.plugins.middleman;

import de.saumya.mojo.ruby.gems.GemException;
import de.saumya.mojo.ruby.script.Script;
import de.saumya.mojo.ruby.script.ScriptException;
import org.apache.maven.plugin.MojoExecutionException;

import java.io.IOException;

/**
 * @goal server
 * @requiresProject true
 */
public class ServerMojo extends AbstractMiddlemanMojo {

    @Override
    public void executeMiddleman() throws MojoExecutionException, ScriptException, IOException, GemException {
        final Script script = factory.newScriptFromSearchPath("middleman");
        script.addArg("server");
        script.executeIn(launchDirectory());
    }

}
@@ -371,16 +371,244 @@
 Mojo %7B%0A%0A
+    /** @parameter default-value=%22false%22 expression=%22$%7Bmiddleman.force_polling%7D%22 */%0A    protected boolean forcePolling;%0A%0A    /** @parameter default-value=%220.25%22 expression=%22$%7Bmiddleman.latency%7D%22 */%0A    protected float latency;%0A%0A
     @Ove
@@ -829,24 +829,203 @@
 (%22server%22);%0A
+%0A        if (forcePolling) %7B%0A            script.addArg(%22--force-polling%22);%0A        %7D%0A%0A        if (latency != 0.25) %7B%0A            script.addArg(%22--latency=%22 + latency);%0A        %7D%0A%0A
         scri

add force pooling and latency to server mojo