public class GeneratorAntTask
extends org.apache.tools.ant.Task
<project default="genfiles" basedir=".">
<property name="generated.source.dir" value="${basedir}" />
<target name="genfiles" description="Generate the files">
<taskdef name="mbgenerator"
classname="org.mybatis.generator.ant.GeneratorAntTask"
classpath="mybatis-generator-core-x.x.x.jar" />
<mbgenerator overwrite="true" configfile="generatorConfig.xml" verbose="false" >
<propertyset>
<propertyref name="generated.source.dir"/>
</propertyset>
</mbgenerator>
</target>
</project>
The task requires that the attribute "configFile" be set to an existing XML configuration file.
The task supports these optional attributes:
| Constructor and Description |
|---|
GeneratorAntTask() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.tools.ant.types.PropertySet |
createPropertyset() |
void |
execute() |
String |
getConfigfile() |
String |
getContextIds() |
String |
getFullyQualifiedTableNames() |
boolean |
isOverwrite() |
boolean |
isVerbose() |
void |
setConfigfile(String configfile) |
void |
setContextIds(String contextIds) |
void |
setFullyQualifiedTableNames(String fullyQualifiedTableNames) |
void |
setOverwrite(boolean overwrite) |
void |
setVerbose(boolean verbose) |
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypepublic void execute()
execute in class org.apache.tools.ant.Taskpublic String getConfigfile()
public void setConfigfile(String configfile)
public boolean isOverwrite()
public void setOverwrite(boolean overwrite)
public org.apache.tools.ant.types.PropertySet createPropertyset()
public boolean isVerbose()
public void setVerbose(boolean verbose)
public String getContextIds()
public void setContextIds(String contextIds)
public String getFullyQualifiedTableNames()
public void setFullyQualifiedTableNames(String fullyQualifiedTableNames)
Copyright © 2006–2025 MyBatis.org. All rights reserved.