批处理编译器 Ant 任务
Ant 任务 JspC 列出所有批处理编译器配置选项。它在保护下运行批处理编译器。它与 WebSphere® Application Server 5.x 版本的 JspC Ant 任务向后兼容。下表列出所有 Ant 任务属性及其等价的批处理编译器参数。
JspC 属性 | 等效批处理编译器参数 |
---|---|
earPath | -ear.path |
warPath | -war.path |
src 与 warPath 相同,支持向后兼容 |
-war.path |
enterpriseAppName | -enterpriseapp.name |
responseFile | -response.file |
webmoduleName | -webmodule.name |
fileName | -filename -config.root |
configRoot | -config.root |
cellName | -cell.name |
nodeName | -node.name |
serverName | -server.name |
profileName | -profileName |
extractToDir | -extractToDir |
compileToDir 与 compileToDir 相同,支持向后兼容 |
-compileToDir -compileToDir |
compileToWebInf | -compileToWebInf |
compilerOptions | -compilerOptions |
recurse | -recurse |
removeTempDir | -removeTempDir |
translate | -translate |
compile | -compile |
forceCompilation | -forceCompilation |
useFullPackageNames | -useFullPackageNames |
trackDependencies | -trackDependencies |
createDebugClassfiles | -createDebugClassfiles |
keepgenerated | -keepgenerated |
keepGeneratedclassfiles | -keepGeneratedclassfiles |
usePageTagPool | -usePageTagPool |
useThreadTagPool | -useThreadTagPool |
classloaderParentFirst | -classloader.parentFirst |
classloaderSingleWarClassloader | -classloader.singleWarClassloader |
additionalClasspath | -additional.classpath |
classpath 与 additionalClasspath 相同,支持向后兼容 |
-additional.classpath |
verbose | -verbose |
deprecation | -deprecation |
javaEncoding | -javaEncoding |
compileWithAssert | -compileWithAssert |
useJikes | -useJikes |
jspFileExtensions | -jsp.file.extensions |
logLevel | -log.level |
wasHome | none |
Classpathref | none |
jdkSourceLevel | -jdkSourceLevel |
以下示例说明使用多个带有不同属性的目标构建脚本。以下命令用来启动此脚本:
在 Windows 上:
ws_ant -Dwas.home=%WAS_HOME% -Dear.path=%EAR_PATH% -Dextract.dir=%EXTRACT_DIR%
ws_ant jspc2 -Dwas.home=%WAS_HOME% -Dapp.name=%APP_NAME% -Dwebmodule.name=%MOD_NAME%
ws_ant jspc3 -Dwas.home=%WAS_HOME% -Dapp.name=%APP_NAME% -Dwebmodule.name=%MOD_NAME% -Ddir.name=%DIR_NAME%
在 UNIX 或 i5/OS™ 上:
ws_ant -Dwas.home=$WAS_HOME -Dear.path=$EAR_PATH -Dextract.dir=$EXTRACT_DIR
ws_ant jspc2 -Dwas.home=$WAS_HOME -Dapp.name=$APP_NAME -Dwebmodule.name=$MOD_NAME
ws_ant jspc3 -Dwas.home=$WAS_HOME -Dapp.name=$APP_NAME -Dwebmodule.name=$MOD_NAME -Ddir.name=$DIR_NAME
使用 JspC 任务的示例 build.xml 文件
<project name="JSP Precompile" default="jspc1" basedir=".">
<taskdef name="wsjspc" classname="com.ibm.websphere.ant.tasks.JspC"/>
<target name="jspc1" description="example using a path to an EAR, and extracting the EAR to a directory">
<wsjspc wasHome="${was.home}"
earpath="${ear.path}"
forcecompilation="true"
extractToDir="${extract.dir}"
useThreadTagPool="true"
keepgenerated="true"
/>
</target>
<target name="jspc2" description="example using an enterprise app and webmodule">
<wsjspc wasHome="${was.home}"
enterpriseAppName="${app.name}"
webmoduleName="${webmodule.name}"
removeTempDir="true"
forcecompilation="true"
keepgenerated="true"
/>
</target>
<target name="jspc3" description="example using an enterprise app, webmodule and specific directory">
<wsjspc wasHome="${was.home}"
enterpriseAppName="${app.name}"
webmoduleName="${webmodule.name}"
fileName="${dir.name}"
recurse="false"
forcecompilation="true"
keepgenerated="true"
/>
</target>
</project>