net.sourceforge.cruisecontrol.builders
Class MavenBuilder

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.util.PerDayScheduleItem
      extended bynet.sourceforge.cruisecontrol.Builder
          extended bynet.sourceforge.cruisecontrol.builders.MavenBuilder
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class MavenBuilder
extends Builder

Maven builder class. Attempts to mimic the behavior of Ant builds, at least as far as CC is concerned. Basically it's a (heavily) edited version of AntBuilder. No style at all, but serves its purpose. :)

Author:
Florin Vancea
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.cruisecontrol.util.PerDayScheduleItem
INVALID_NAME_OF_DAY, NOT_SET
 
Constructor Summary
MavenBuilder()
           
 
Method Summary
 org.jdom.Element build(java.util.Map buildProperties)
          build and return the results via xml.
 org.jdom.Element buildWithTarget(java.util.Map properties, java.lang.String target)
           
protected  java.util.List getGoalSets()
          Produces sets of goals, ready to be run each in a distinct call to Maven.
 void setGoal(java.lang.String goal)
          Maven goal to run.
 void setMavenScript(java.lang.String mavenScript)
          The path to the Maven script (i.e. the maven.bat file, because I tested this only on w2k)
 void setProjectFile(java.lang.String projectFile)
          project.xml to use
 void setTimeout(long timeout)
          Sets build timeout in seconds.
 void validate()
           
 
Methods inherited from class net.sourceforge.cruisecontrol.Builder
compareTo, getGroup, getMultiple, getTime, isValidDay, setGroup, setMultiple, setTime
 
Methods inherited from class net.sourceforge.cruisecontrol.util.PerDayScheduleItem
getDay, setDay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MavenBuilder

public MavenBuilder()
Method Detail

validate

public void validate()
              throws CruiseControlException
Overrides:
validate in class Builder
Throws:
CruiseControlException

build

public org.jdom.Element build(java.util.Map buildProperties)
                       throws CruiseControlException
build and return the results via xml. debug status can be determined from log4j category once we get all the logging in place.

Specified by:
build in class Builder
Throws:
CruiseControlException

buildWithTarget

public org.jdom.Element buildWithTarget(java.util.Map properties,
                                        java.lang.String target)
                                 throws CruiseControlException
Specified by:
buildWithTarget in class Builder
Throws:
CruiseControlException

setMavenScript

public void setMavenScript(java.lang.String mavenScript)
The path to the Maven script (i.e. the maven.bat file, because I tested this only on w2k)


setGoal

public void setGoal(java.lang.String goal)
Maven goal to run. Supports sets of goals. Examples: "clean java:compile" will run 'clean' then 'java:compile' in one single invocation of Maven "clean jar:jar|site:generate" will run 'clean' and 'jar:jar' in one invocation, then 'site:generate' in _another_ invocation. Useful for updating from SCM with Maven goals, then doing the actual build with freshly loaded files. Notice the '|' as separator of sets.


setProjectFile

public void setProjectFile(java.lang.String projectFile)
project.xml to use


getGoalSets

protected java.util.List getGoalSets()
Produces sets of goals, ready to be run each in a distinct call to Maven. Separation of sets in "goal" attribute is made with '|'.

Returns:
a List containing String elements

setTimeout

public void setTimeout(long timeout)
Sets build timeout in seconds.

Parameters:
timeout - long build timeout