아래 내용의 기반은 RSA/RAD의 Help 파일에서 찾아낸 것임.
http://127.0.0.1:49212/help/topic/com.ibm.etools.ant.tasks.doc/topics/ph-antgeneral.html
배치 파일 하나와 ant 스크립트를 이용한다.
runAnt.bat
===================================================================================
@echo off
setlocal
REM set BASE_DIR=%~dp0
set BASE_DIR=C:\Program Files\IBM\SDP70\bin\
:java
@if "%JAVA_HOME%"=="" set JAVA_HOME=%BASE_DIR%..\eclipse
@if not exist "%JAVA_HOME%\jre\bin" set JAVA_HOME=%BASE_DIR%..\jdk
@if not exist "%JAVA_HOME%\jre\bin" echo ERROR: JAVA_HOME must point to Java installation containing jre\bin
@if not exist "%JAVA_HOME%\jre\bin" goto done
:startup
set STARTUP_JAR="%BASE_DIR%..\startup.jar"
@if not exist %STARTUP_JAR% set STARTUP_JAR="%BASE_DIR%..\eclipse\startup.jar"
@if not exist %STARTUP_JAR% echo ERROR: Unable to locate Eclipse startup.jar
@if not exist %STARTUP_JAR% goto done
:run
@echo on
REM "%JAVA_HOME%\jre\bin\java.exe" -Xms512m -Xmx512m -Dwtp.autotest.noninteractive=true -cp %STARTUP_JAR% org.eclipse.core.launcher.Main -application com.ibm.etools.j2ee.ant.RunAnt -data "%WORKSPACE%" %*
"%JAVA_HOME%\jre\bin\java.exe" -Xms512m -Xmx512m -Dwtp.autotest.noninteractive=true -cp %STARTUP_JAR% org.eclipse.core.launcher.Main -application com.ibm.etools.j2ee.ant.RunAnt -data %*
@if %ERRORLEVEL% EQU 0 goto done
@if %ERRORLEVEL% EQU 13 echo runAnt BUILD FAILED.
@if %ERRORLEVEL% EQU 13 goto done
@if %ERRORLEVEL% EQU 15 echo WORKSPACE is already BEING USED.
@if %ERRORLEVEL% EQU 15 goto done
@if %ERRORLEVEL% EQU 23 echo totally clean (UNINITIALIZED) workspace, it is now setup. will rerun...
@if %ERRORLEVEL% EQU 23 goto run
@echo runAnt FAILED? (return code %ERRORLEVEL%)
:pause
@pause
:done
====================================================================================
WASUtil.xml
<?xml version="1.0" encoding="EUC-KR"?>
<project name="WAS_Service" default="EARExport" basedir="." >
<!-- WebSphere Section -->
<target name="EARExport">
<earExport EARProjectName="${EARProject.Name}" EARExportFile="${Target.Path}\${EARProject.Name}.ear" Overwrite="true" />
</target>
<target name="EJBDeploy">
<ejbDeploy EJBProject="${EJBProject.Name}" NoValidate="true" Quiet="true" IgnoreErrors="true"/>
</target>
<target name="JARExport">
<appClientExport AppClientProjectName="${UtilProject.Name}" AppClientExportFile="${UtilProject.Name}.jar"/>
</target>
<target name="ProjectBuild">
<projectBuild ProjectName="${Project.Name}" failonerror="true" DebugCompilation="false" BuildType="full" />
<echo message="projectBuild: projectName=${projectName} project Error Count=${ProjectErrorCount} project Error Messages=${ProjectErrorMessages}" />
</target>
<!-- End of WebSphere Section -->
</project>
실행할 때는...
runAnt c:\daeshin -f c:\BuildServer\scripts\WASUtil.xml EJBDeploy -DEJBProject.Name=DSGiantEJB
runAnt c:\daeshin -f c:\BuildServer\scripts\WASUtil.xml JARExport -DUtilProject.Name=NE0201_ApplicationLibrary
runAnt c:\daeshin -f c:\BuildServer\scripts\WASUtil.xml EARExport -DEARProject.Name=DSCmrEAR -DTarget.Path=C:
이 글은 스프링노트에서 작성되었습니다.