org.apache.maven.ant
Class MavenTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.apache.maven.ant.MavenTask

public class MavenTask
extends org.apache.tools.ant.Task

Allows Ant to "wrap" Maven. One might use it in an ant build.xml thusly:

 <target name="masterbuild">
 <taskdef name="maven" classname="org.apache.maven.ant.MavenTask"/>
 <maven mavenHome="/usr/local/maven"
 goalName="masterbuild"
 projectBuildFile="maven.xml"
 projectFileName="project-CurrentMavenGeneration.xml"
 toolsJar="/usr/local/jdk/lib/tools.jar"
 />
 </target>
 

Version:
1.0
Author:
James CE Johnson

Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
MavenTask()
           
 
Method Summary
 void execute()
          Does the work.
 java.lang.String getGoalName()
          Gets the value of goalName
 java.lang.String getMavenHome()
          Gets the value of mavenHome
 java.lang.String getProjectBuildFile()
          Gets the value of projectBuildFile
 java.lang.String getProjectFileName()
          Gets the value of projectFileName
 java.lang.String getToolsJar()
          Gets the value of toolsJar
 void setGoalName(java.lang.String argGoalName)
          Sets the value of goalName
 void setMavenHome(java.lang.String argMavenHome)
          Sets the value of mavenHome
 void setProjectBuildFile(java.lang.String argProjectBuildFile)
          Sets the value of projectBuildFile (e.g.
 void setProjectFileName(java.lang.String argProjectFileName)
          Sets the value of projectFileName (e.g.
 void setToolsJar(java.lang.String argToolsJar)
          Sets the value of toolsJar
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MavenTask

public MavenTask()
Method Detail

getProjectFileName

public java.lang.String getProjectFileName()
Gets the value of projectFileName

Returns:
the value of projectFileName

setProjectFileName

public void setProjectFileName(java.lang.String argProjectFileName)
Sets the value of projectFileName (e.g. - project.xml)

Parameters:
argProjectFileName - Value to assign to this.projectFileName

getProjectBuildFile

public java.lang.String getProjectBuildFile()
Gets the value of projectBuildFile

Returns:
the value of projectBuildFile

setProjectBuildFile

public void setProjectBuildFile(java.lang.String argProjectBuildFile)
Sets the value of projectBuildFile (e.g. - maven.xml)

Parameters:
argProjectBuildFile - Value to assign to this.projectBuildFile

getGoalName

public java.lang.String getGoalName()
Gets the value of goalName

Returns:
the value of goalName

setGoalName

public void setGoalName(java.lang.String argGoalName)
Sets the value of goalName

Parameters:
argGoalName - Value to assign to this.goalName

getMavenHome

public java.lang.String getMavenHome()
Gets the value of mavenHome

Returns:
the value of mavenHome

setMavenHome

public void setMavenHome(java.lang.String argMavenHome)
Sets the value of mavenHome

Parameters:
argMavenHome - Value to assign to this.mavenHome

getToolsJar

public java.lang.String getToolsJar()
Gets the value of toolsJar

Returns:
the value of toolsJar

setToolsJar

public void setToolsJar(java.lang.String argToolsJar)
Sets the value of toolsJar

Parameters:
argToolsJar - Value to assign to this.toolsJar

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Does the work.

Throws:
org.apache.tools.ant.BuildException - Thrown in unrecoverable error.


Copyright © 2001-2005 Apache Software Foundation. All Rights Reserved.