net.sourceforge.cruisecontrol.builders
Class Maven2Script

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.builders.Maven2Script
All Implemented Interfaces:
Script, StreamConsumer

public final class Maven2Script
extends java.lang.Object
implements Script, StreamConsumer

Maven2 script class based on the Maven builder class from Eric Pugh.
Contains all the details related to running a Maven based build.

Author:
Steria Benelux Sa/Nv - Provided without any warranty

Constructor Summary
Maven2Script(Maven2Builder maven2Builder, org.jdom.Element buildLogElement, java.lang.String goals, Progress progress)
           
 
Method Summary
 Commandline buildCommandline()
          Construct the command that we're going to execute.
 void consumeLine(java.lang.String line)
          Analyze the output of the mvn command.
protected  void flushCurrentElement()
           
 int getExitCode()
           
 void setBuildProperties(java.util.Map buildProperties)
           
 void setExitCode(int exitCode)
          exitCode is what is returned from running the script
 void setGoalset(java.lang.String goalset)
           
 void setMvnScript(java.lang.String mvnScript)
           
 void setPomFile(java.lang.String pomFile)
           
 void setProperties(java.util.List properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Maven2Script

public Maven2Script(Maven2Builder maven2Builder,
                    org.jdom.Element buildLogElement,
                    java.lang.String goals,
                    Progress progress)
Parameters:
maven2Builder - the maven2builder executing this script
buildLogElement - Log to store result of the execution for CC
goals - the goalset to execute
progress - used to update progress
Method Detail

buildCommandline

public Commandline buildCommandline()
                             throws CruiseControlException
Construct the command that we're going to execute.

Specified by:
buildCommandline in interface Script
Returns:
Commandline holding command to be executed
Throws:
CruiseControlException

consumeLine

public void consumeLine(java.lang.String line)
Analyze the output of the mvn command. This is used to detect errors or successful build.

Specified by:
consumeLine in interface StreamConsumer

flushCurrentElement

protected void flushCurrentElement()

setBuildProperties

public void setBuildProperties(java.util.Map buildProperties)
Parameters:
buildProperties - The buildProperties to set.

setGoalset

public void setGoalset(java.lang.String goalset)
Parameters:
goalset - The goalset to set.

setMvnScript

public void setMvnScript(java.lang.String mvnScript)
Parameters:
mvnScript - The mavenScript to set.

setPomFile

public void setPomFile(java.lang.String pomFile)
Parameters:
pomFile - The projectFile to set.

setProperties

public void setProperties(java.util.List properties)
Parameters:
properties - The properties to set.

getExitCode

public int getExitCode()
Specified by:
getExitCode in interface Script
Returns:
the exitCode.

setExitCode

public void setExitCode(int exitCode)
Description copied from interface: Script
exitCode is what is returned from running the script

Specified by:
setExitCode in interface Script
Parameters:
exitCode - The exitCode to set.