📜  Apache Ant Java任务

📅  最后修改于: 2020-12-26 13:58:47             🧑  作者: Mango

Apache Ant Java任务

此任务用于在Ant JVM内部执行Java代码。我们还可以通过将fork属性设置为true来使用其他(外部)JVM。

要获取fork JVM的输入,我们可以使用input和inputstring属性。

Apache Ant Java任务属性

Attribute Description Required
classname A Java class which is to be executed. Exactly one of the three
jar Jar file with location.
module Main module name to resolve.
args The arguments for the class that is executed. No
classpath The classpath to use. No
classpathref The classpath to use with path reference. No
modulepath It is used to specify module path. No
modulepathref The modulepath with path reference. No
fork If enabled triggers the class execution in another JVM. No
spawn It is used to allow to start a process which will outlive Ant. No
jvm It is a command used to run JVM. No
jvmargs The JVM arguments, passed to the JVM. No
maxmemory Max amount of memory to allocate to the forked JVM. No
failonerror It stops the build process. No
resultproperty The name of a property in which the return code of the command should be stored. No
dir The directory to be include in run. No
output Output file name. No
error Error file name. No
logError To get errors log, store into a file. No
append Whether output and error files should be appended to or overwritten./td> No
outputproperty A property in which the output of the command should be stored. No
errorproperty A property in which the standard error of the command should be stored. No

Apache Ant Java任务示例

本示例将运行Java类Hello

    
    
        
            
        
    

以最大内存128 MB运行JAR。