|
Working with Entity bean using JPA |
|
value=”${dirs.base}/build/war”/>
<property name=”jarDir”
value=”${dirs.base}/build/jar”/>
<!— classpath for Project —>
<path id=”library.classpath”>
<pathelement path =”libext/servletapi.
jar”/>
<pathelement path =”libext/ejb3-
persistence.jar”/>
<pathelement path =”libext/javaee.jar”/
>
<pathelement path =”${classpath}”/>
</path>
<!— Create Web-inf and classes
directories —>
<mkdir dir=”${warDir}/WEB-INF”/>
<mkdir dir=”${warDir}/WEB-INF/
classes”/>
<!— Create Meta-inf and classes
directories —>
<mkdir dir=”${earDir}/META-INF”/>
<mkdir dir=”${jarDir}/META-INF”/>
<mkdir dir=”${classdir}”/>
</target>
<!— Main target —>
<target name=”all”
depends=”init,build,buildWar,buildJar,buildEar”/
>
<!— Compile Java Files and store in /build/
src directory —>
<target name=”build” >
<javac srcdir=”${src}”
destdir=”${classdir}” debug=”true”
includes=”**/*.java” >
<classpath refid=”library.classpath”/>
</javac>
</target>
<!— Create the web archive File —>
<target name=”buildWar” depends=”init”>
<copy todir=”${warDir}/WEB-INF/
classes”>
<fileset dir=”${classdir}”
includes=”**/*.class” />
</copy>
<copy todir=”${warDir}/WEB-INF”>
<fileset
dir=”${deploymentdescription}/web/”
includes=”web.xml” />
</copy>
<copy todir=”${warDir}”>
<fileset dir=”${web}” includes=”**/*.*” />
</copy>
|
|
<!— Create war file and place in ear
directory —> <jar jarfile=”${earDir}/
${warFile}” basedir=”${warDir}” />
</target>
<!— Create the jar File —>
<target name=”buildJar” depends=”init”>
<copy todir=”${jarDir}”>
<fileset dir=”${classdir}”
includes=”**/*.class” />
</copy>
<copy todir=”${jarDir}/META-INF”>
<fileset
dir=”${deploymentdescription}/jar/”
includes=”ejb-jar.xml,weblogic-cmp-rdbmsjar.
xml,weblogic-ejb-jar.xml,persistence.xml”
/>
</copy>
<!— Create jar file and place in ear
directory —>
<jar jarfile=”${earDir}/${jarFile}”
basedir=”${jarDir}” />
</target>
<!— Create the ear File —>
<target name=”buildEar” depends=”init”>
<copy todir=”${earDir}/META-INF”>
<fileset
dir=”${deploymentdescription}/ear”
includes=”application.xml, jboss-app.xml” />
</copy>
<!— Create ear file and place in ear
directory —>
<jar jarfile=”../${earFile}”
basedir=”${earDir}” />
<copy todir=”C:/jboss-4.2.0.GA/
server/default/deploy/”>
<fileset dir=”../”
includes=”${earFile}” />
</copy>
</target>
</project>
Put this file in the base
(EntityBean\code)directory. Application.xml
<?xml version=”1.0" encoding=”UTF-8"?>
<application xmlns=”http://java.sun.com/
xml/ns/javaee” xmlns:xsi=”http://
www.w3.org/2001/XMLSchema-instance” |
|
Feb 2008 | Java Jazz Up | 13 |
|
|
|
View All Topics |
All Pages of this Issue |
Pages:
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53 ,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63 ,
64,
65 ,
66 ,
67 ,
68 ,
69 ,
70 ,
71 ,
72 ,
Download PDF |
|
|
|
|
|
|
|
|
|