Professional Documents
Culture Documents
Tutorial
# %
& "
0 $. $* .
%)
0 1 /'2 34
53
# ' "
0 % 6
7 "
8
0 % 6
0 .
6
0 /
65$- 9
!
0 6)% .
0 :'2 6
! "
()* +
0 :'2 6
""
0 65-- ; :'2
0 65-- ; :'2
# $
0 1 :'2
:$2 7 6
#
8
""
0 % < $
6
'' "
# 0 1 6 -- 7
$
%
& $ . ' 8
'
()' * +, )-. 0 1 <
$
/ # $ $
76$*+6$=+$+$ 8
0 1 -6)5
>? 7
. $ 8
0 .
6 --
$
7.
8
0 1 $
0 1 @
0 #
.
,,,
2. Referrals
TRIVERA TECHNOLOGIES is not responsible for any contents referred to from their presentation -unless TRIVERA
TECHNOLOGIES has full knowledge of illegal contents and would be able to prevent the readers from viewing those
pages. If any damage occurs by the use of information presented there, only the author of the respective pages might
be liable, not TRIVERA TECHNOLOGIES who has linked to these pages.
3. Copyright
TRIVERA TECHNOLOGIES intended not to use any copyrighted material for the publication or, if not possible, to
indicate the copyright of the respective object. The copyright for any material created by the authors of TRIVERA
TECHNOLOGIES is reserved. Any duplication or use of objects such as diagrams, texts in electronic form or printed
publications is not permitted without TRIVERA TECHNOLOGIES agreement in writing.
This material is copyrighted by TRIVERA TECHNOLOGIES. and shall not be reproduced, edited, or distributed, in hard
copy or soft copy format, without the express written consent of TRIVERA TECHNOLOGIES
For more information about Java or Enterprise Java courseware, please contact Trivera Technologies EMEAA. Our
courseware is available globally for license, instruction, customization and/or purchase.
Copyright © 2007 Trivera Technologies. Java, Enterprise JavaBeans and all Java-based trademarks and logo
trademarks are registered trademarks of Sun Microsystems, Inc., in the United States and other countries. List of
Trademarks: IBM, the IBM logo, WebSphere, or registered trademarks of International Business Machines Corporation
in the United States, other countries, or both. Microsoft, Windows XP and Windows NT are registered trademarks of
Microsoft Corporation in the United States, other countries, or both. Other company, product, or service names may be
trademarks or service marks of others.
/ . .,# # # -'-.. ""
. . 6"
(
'
' A
B &++ +C
#
.,#
.,#
.,#
=
.,# 7 &++ +8
-
,
A
+
7
8 $
6
(
6
(
. /
# A
A
" )
build.xml
#
:'2
#
default
7 8 # basedir
"
(
.
<
.
< .
A
< A
<target name="compile">
...
</target>
<target name="init">
<tstamp/>
</target>
<target name="compile" depends="init">
...
</target>
#
7 H"H
"
. .,#
# .,#
%
2 4 -
javac 7
8
<javac srcdir="../src"
destdir="../classes" >
<include name="**/*.java"/>
<exclude name="**/Test-.java"/>
</javac>
.,#
"
.,#
)
.,#
.,#
taskdef
%
2 9 -
< A
.,#
<taskdef name="wldeploy"
classname="weblogic.ant.taskdefs.management.WLDeploy">
<classpath path="${home.wls}/server/lib/weblogic.jar"/>
</taskdef>
<wldeploy action="deploy" source="${earFile}" name="${baseName}"
user="${wls.username}" password="${wls.password}"
verbose="true" adminurl="${wls.url}"
debug="true" upload="true"/>
.
-
7
"
8
<echo>${ApplicationName}</echo>
*
( "
dir.src=../src
dir.resources=../resources
dir.classes=../classes
dir.lib=../lib
spring.home=c:/spring2.0
spring.lib=${spring.home}/lib
,
.
)
&
<property file="../global-build.properties"/>
.,#
" &
(
< 6
6 $- I
#
6 $- I
0
#
.,#
"
7
A
A8
ant compile
<
7
default
project
8
< .,#
build.xml .
-f
ant -f c:/mybuild/testbuild.xml
) -projecthelp .,#
% 2 39
ant -projecthelp
% 2 3I
Buildfile: build.xml
Main targets:
compile compile the Java classes
Default target: init
,
#1
/
<
6
<
classpath
7
8 javac
% 2 3G
@
path
% 2 3M
<path id="class.path">
<pathelement location="${dir.lib}"/>
<pathelement path="${dir.classes}/"/>
<pathelement path="${spring.lib}"/>
</path>
% 2 3N
% 2 5?
#
%
7 8 .,# '
if unless
)
,
if unless
0 if&
0 unless&
<
condition
%
2 55 %
condition
.
&
<available file="myfile.txt"
%
2 54 os
<os family="windows"
$
&
7 '
<
8
7 ' $
'
<
$+58
7 . '
8 7 /
/"
8 7 , , < 8 +5 7 $+58
7
@*A ,$ E "
#
8 N ' <
N9
NM '-
%- ' <
,#"
<
5??? :*
P+ P+$
$+>N? +4?? $+4??
1'$
B &++ +
+% #+
C
%
2 59 equals
%
2 5I isset
<isset property="javaVersionIs1.6"/>
Recommended Resources: