[jboss-cvs] jboss-docs/jbossas/j2ee/examples ...
Norman Richards
norman.richards at jboss.com
Wed Nov 1 13:14:13 EST 2006
User: nrichards
Date: 06/11/01 13:14:13
Added: jbossas/j2ee/examples build-jca.xml build-jms.xml
build-jmx.xml build-misc.xml build-naming.xml
build-security.xml build.xml
Log:
modified for j2ee guide
Revision Changes Path
1.1 date: 2006/11/01 18:14:13; author: nrichards; state: Exp;jboss-docs/jbossas/j2ee/examples/build-jca.xml
Index: build-jca.xml
===================================================================
<project name="JCA chapter examples" default="build-all">
<property name="src.root" value="src/main/org/jboss/book/jca" />
<property name="chapter.dir" value="${build.dir}/jca" />
<target name="prepare">
<mkdir dir="${chapter.dir}" />
</target>
<target name="build-all">
<antcall target="jca-ex1-rar" />
<antcall target="jca-ex1-jar" />
</target>
<target name="config">
<copy file="${chapter.dir}/jca-ex1.rar" todir="${jboss.deploy.dir}"
overwrite="true" />
<copy file="${src.root}/ex1/notxfs-ds.xml" todir="${jboss.deploy.dir}"
overwrite="true" />
</target>
<target name="jca-ex1-rar" depends="prepare">
<jar jarfile="${chapter.dir}/ra.jar">
<fileset dir="${build.classes.dir}"
includes="org/jboss/book/jca/ex1/ra/**" />
</jar>
<jar jarfile="${chapter.dir}/jca-ex1.rar">
<metainf dir="${src.root}/ex1/ra" includes="ra.xml"/>
<fileset dir="${chapter.dir}"
includes="ra.jar" />
</jar>
</target>
<target name="jca-ex1-jar" depends="prepare">
<jar jarfile="${chapter.dir}/jca-ex1.jar">
<metainf dir="${src.root}/ex1" includes="ejb-jar.xml,jboss.xml"/>
<fileset dir="${build.classes.dir}"
includes="org/jboss/book/jca/ex1/*"
excludes="org/jboss/book/jca/ex1/ExClient.class" />
</jar>
</target>
<!-- Examples -->
<target name="run-example1" depends="jca-ex1-jar">
<copy file="${chapter.dir}/jca-ex1.jar" todir="${jboss.deploy.dir}"
overwrite="true" />
<echo message="Waiting for deploy..." />
<sleep seconds="5"/>
<java classname="org.jboss.book.jca.ex1.ExClient"
classpath="${client.path}" fork="true" >
</java>
</target>
</project>
1.1 date: 2006/11/01 18:14:13; author: nrichards; state: Exp;jboss-docs/jbossas/j2ee/examples/build-jms.xml
Index: build-jms.xml
===================================================================
<project name="JMS Chapter Examples" default="build-all">
<property name="src.root" value="src/main/org/jboss/book/jms" />
<property name="chapter.dir" value="${build.dir}/jms" />
<property name="chapter.ex" value="jms-ex${ex}" />
<path id="chapter.path">
<pathelement location="src/main" />
<pathelement location="output/classes" />
<pathelement path="${client.path}" />
</path>
<target name="prepare">
<mkdir dir="${chapter.dir}" />
</target>
<target name="jms-ex2-jar" depends="prepare">
<jar jarfile="${chapter.dir}/jms-ex2.jar">
<metainf dir="${src.root}/ex2" includes="*.xml"/>
<fileset dir="${build.classes.dir}" includes="org/jboss/book/jms/ex2/**"/>
</jar>
</target>
<target name="jms-ex3-jar" depends="prepare">
<jar jarfile="${chapter.dir}/jms-ex3.jar">
<metainf dir="${src.root}/ex3" includes="*.xml"/>
<fileset dir="${build.classes.dir}" includes="org/jboss/book/jms/ex3/**"/>
</jar>
</target>
<target name="build-all">
<antcall target="jms-ex2-jar" />
</target>
<target name="run-example1p2p">
<java classname="org.jboss.book.jms.ex1.SendRecvClient"
classpathref="chapter.path" fork="true" />
</target>
<target name="run-example1p2pex">
<java classname="org.jboss.book.jms.ex1.SendRecvExListenerClient"
classpathref="chapter.path" fork="true" />
</target>
<target name="run-example1p2psecure">
<java classname="org.jboss.book.jms.ex1.SecureSendRecvClient"
classpathref="chapter.path" fork="true" />
</target>
<target name="run-example1ps">
<java classname="org.jboss.book.jms.ex1.TopicSendRecvClient"
classpathref="chapter.path" fork="true" />
</target>
<target name="run-example1ps2">
<java classname="org.jboss.book.jms.ex1.TopicSendClient"
classpathref="chapter.path" fork="true" />
<java classname="org.jboss.book.jms.ex1.TopicRecvClient"
classpathref="chapter.path" fork="true" />
</target>
<target name="run-example1psdt">
<java classname="org.jboss.book.jms.ex1.DurableTopicSetup"
classpathref="chapter.path" fork="true" />
<java classname="org.jboss.book.jms.ex1.TopicSendClient"
classpathref="chapter.path" fork="true" />
<java classname="org.jboss.book.jms.ex1.DurableTopicRecvClient"
classpathref="chapter.path" fork="true" />
</target>
<target name="run-example1dt">
<java classname="org.jboss.book.jms.ex1.DurableTopicClient"
classpathref="chapter.path" fork="true" />
</target>
<target name="run-example2" depends="jms-ex2-jar">
<copy file="${chapter.dir}/jms-ex2.jar" todir="${jboss.deploy.dir}"
overwrite="true" />
<echo message="Waiting 5 seconds for deploy..." />
<sleep seconds="5"/>
<java classname="org.jboss.book.jms.ex2.SendRecvClient"
classpathref="chapter.path" fork="true" />
</target>
<target name="run-example2np">
<copy file="${chapter.dir}/jms-ex2.jar" todir="${jboss.deploy.dir}"
overwrite="true" />
<echo message="Waiting 5 seconds for deploy..." />
<sleep seconds="5"/>
<java classname="org.jboss.book.jms.ex2.SendRecvClientNP"
classpathref="chapter.path" fork="true">
</java>
</target>
<target name="run-example3" depends="jms-ex3-jar">
<copy file="${chapter.dir}/jms-ex3.jar" todir="${jboss.deploy.dir}"
overwrite="true" />
<echo message="Waiting 5 seconds for deploy..." />
<sleep seconds="5"/>
<java classname="org.jboss.book.jms.ex3.SendRecvClient"
classpathref="chapter.path" fork="true" />
</target>
</project>
1.1 date: 2006/11/01 18:14:13; author: nrichards; state: Exp;jboss-docs/jbossas/j2ee/examples/build-jmx.xml
Index: build-jmx.xml
===================================================================
<!-- Build script for the chapter 2 examples -->
<project name="Chapter 2 build" default="build-all">
<property name="src.root" value="src/main/org/jboss/book/jmx" />
<property name="chapter.dir" value="${build.dir}/jmx" />
<property name="chapter.ex" value="jmx-ex${ex}" />
<path id="chapter.path">
<pathelement location="src/main"/>
<pathelement path="${client.path}" />
<pathelement location="${jboss.dist}/lib/jboss-jmx.jar"/>
<pathelement location="${jboss.dist}/client/jbossall-client.jar" />
<pathelement location="${jboss.dist}/lib/dom4j.jar" />
</path>
<target name="build-all">
<antcall target="jmx-ex0-jars" />
<antcall target="jmx-ex1-sar" />
<antcall target="jmx-ex1xmbean1-sar" />
<antcall target="jmx-ex1xmbean2-sar" />
<antcall target="jmx-ex1xmbean3-sar" />
<antcall target="jmx-ex2-sar" />
<antcall target="jmx-ex3-ear" />
<antcall target="rmic" />
</target>
<target name="rmic">
<rmic base="${build.classes.dir}" classpathref="chapter.path"
includes="org/jboss/book/jmx/xmbean/TestXMBean1$*.class"/>
</target>
<target name="prepare">
<mkdir dir="${chapter.dir}" />
</target>
<target name="config">
</target>
<target name="jmx-ex0-jars" depends="prepare">
<jar jarfile="${chapter.dir}/j0.jar">
<fileset dir="${build.classes.dir}">
<include name="org/jboss/book/jmx/ex0/ExCtx.class" />
<include name="org/jboss/book/jmx/ex0/ExObj*.class" />
</fileset>
</jar>
<jar jarfile="${chapter.dir}/j1.jar">
<fileset dir="${build.classes.dir}">
<include name="org/jboss/book/jmx/ex0/ExCtx.class" />
<include name="org/jboss/book/jmx/ex0/ExObj*.class" />
</fileset>
</jar>
</target>
<target name="jmx-ex1-sar" depends="prepare">
<jar jarfile="${chapter.dir}/jmx-ex1.sar">
<metainf dir="${src.root}/ex1" includes="*.xml"/>
<fileset dir="${build.classes.dir}"
includes="org/jboss/book/jmx/ex1/**"
/>
</jar>
</target>
<!-- The JNDIMap XMBean version 1 -->
<target name="jmx-ex1xmbean1-sar" depends="prepare">
<zip destfile="${chapter.dir}/jmx-ex1xmbean1.sar">
<zipfileset dir="${src.root}/xmbean" prefix="META-INF">
<include name="jboss-service.xml"/>
</zipfileset>
<zipfileset dir="${src.root}/xmbean" fullpath="META-INF/jndimap-xmbean.xml">
<include name="jndimap-xmbean1.xml"/>
</zipfileset>
<fileset dir="${build.classes.dir}"
includes="org/jboss/book/jmx/xmbean/**"
/>
</zip>
</target>
<!-- The JNDIMap XMBean version 2 -->
<target name="jmx-ex1xmbean2-sar" depends="prepare">
<zip destfile="${chapter.dir}/jmx-ex1xmbean2.sar">
<zipfileset dir="${src.root}/xmbean" fullpath="META-INF/jboss-service.xml">
<include name="jboss-service2.xml"/>
</zipfileset>
<zipfileset dir="${src.root}/xmbean" fullpath="META-INF/jndimap-xmbean.xml">
<include name="jndimap-xmbean2.xml"/>
</zipfileset>
<fileset dir="${build.classes.dir}"
includes="org/jboss/book/jmx/xmbean/**"
/>
</zip>
</target>
<!-- The JNDIMap XMBean version 3 -->
<target name="jmx-ex1xmbean3-sar" depends="prepare">
<zip destfile="${chapter.dir}/jmx-ex1xmbean3.sar">
<zipfileset dir="${src.root}/xmbean"
fullpath="META-INF/jboss-service.xml">
<include name="jboss-service3.xml"/>
</zipfileset>
<zipfileset dir="${src.root}/xmbean" prefix="META-INF">
<include name="jndimap-xmbean3.xml"/>
</zipfileset>
<fileset dir="${build.classes.dir}"
includes="org/jboss/book/jmx/xmbean/**"
/>
</zip>
</target>
<target name="jmx-ex2-sar" depends="prepare">
<jar jarfile="${chapter.dir}/jmx-ex2.sar">
<metainf dir="${src.root}/ex2" includes="*.xml"/>
<fileset dir="${build.classes.dir}"
includes="org/jboss/book/jmx/ex2/**"
/>
</jar>
</target>
<target name="jmx-ex3-ear" depends="prepare">
<jar jarfile="${chapter.dir}/jmx-ex3.sar">
<metainf dir="${src.root}/ex3" includes="jboss-service.xml"/>
<fileset dir="${build.classes.dir}"
includes="org/jboss/book/jmx/ex3/EjbMBeanAdaptor.class"
/>
</jar>
<jar jarfile="${chapter.dir}/jmx-ex3.jar">
<metainf dir="${src.root}/ex3" includes="ejb-jar.xml,jboss.xml"/>
<fileset dir="${build.classes.dir}"
includes="org/jboss/book/jmx/ex3/Echo*.class"
/>
</jar>
<ear earfile="${chapter.dir}/jmx-ex3.ear"
appxml="${src.root}/ex3/application.xml">
<metainf dir="${src.root}/ex3">
<include name="jboss-app.xml" />
</metainf>
<fileset dir="${chapter.dir}">
<include name="jmx-ex3.jar" />
<include name="jmx-ex3.sar" />
</fileset>
</ear>
</target>
<!-- The targets for running the examples -->
<target name="run-example0b" depends="jmx-ex0-jars">
<delete file="${build.classes.dir}/org/jboss/book/jmx/ex0/ExCtx.class" />
<delete file="${build.classes.dir}/org/jboss/book/jmx/ex0/ExObj.class" />
<java classname="org.jboss.book.jmx.ex0.ExCCEb" fork="true">
<classpath refid="chapter.path" />
<sysproperty key="chapter.dir" value="${chapter.dir}"/>
<sysproperty key="chapter.ex" value="${chapter.ex}" />
</java>
</target>
<target name="run-example0c" depends="jmx-ex0-jars">
<delete file="${build.classes.dir}/org/jboss/book/jmx/ex0/ExCtx.class" />
<delete file="${build.classes.dir}/org/jboss/book/jmx/ex0/ExObj.class" />
<java classname="org.jboss.book.jmx.ex0.ExCCEc" fork="true">
<classpath refid="chapter.path" />
<sysproperty key="chapter.dir" value="${chapter.dir}"/>
<sysproperty key="chapter.ex" value="${chapter.ex}" />
</java>
</target>
<target name="run-example0d" depends="jmx-ex0-jars">
<delete file="${build.classes.dir}/org/jboss/book/jmx/ex0/ExCtx.class" />
<java classname="org.jboss.book.jmx.ex0.ExIAEd" fork="true">
<classpath refid="chapter.path" />
<sysproperty key="chapter.dir" value="${chapter.dir}"/>
<sysproperty key="chapter.ex" value="${chapter.ex}" />
</java>
</target>
<target name="run-example0e" depends="jmx-ex0-jars">
<delete file="${build.classes.dir}/org/jboss/book/jmx/ex0/ExCtx.class" />
<delete file="${build.classes.dir}/org/jboss/book/jmx/ex0/ExObj.class" />
<delete file="${build.classes.dir}/org/jboss/book/jmx/ex0/ExObj2.class" />
<java classname="org.jboss.book.jmx.ex0.ExLE" fork="true">
<classpath refid="chapter.path" />
<sysproperty key="chapter.dir" value="${chapter.dir}"/>
<sysproperty key="chapter.ex" value="${chapter.ex}" />
</java>
</target>
<target name="run-example1">
<java classname="org.jboss.book.jmx.ex1.TestMySubclass" fork="true">
<classpath refid="chapter.path" />
<classpath>
</classpath>
</java>
</target>
<target name="run-examplexmbean1" depends="rmic,jmx-ex1xmbean1-sar">
<copy file="${chapter.dir}/jmx-ex1xmbean1.sar" todir="${jboss.deploy.dir}" />
<sleep seconds="5"/>
<java classname="org.jboss.book.jmx.xmbean.TestXMBean1" fork="true">
<classpath refid="chapter.path" />
</java>
</target>
<target name="run-examplexmbean2" depends="rmic,jmx-ex1xmbean2-sar">
<delete file="${jboss.deploy.dir}/jmx-ex1xmbean1.sar" />
<copy file="${chapter.dir}/jmx-ex1xmbean2.sar" todir="${jboss.deploy.dir}" />
<sleep seconds="5"/>
<java classname="org.jboss.book.jmx.xmbean.TestXMBean1" fork="true">
<classpath refid="chapter.path" />
</java>
</target>
<target name="run-examplexmbean2a" depends="rmic,jmx-ex1xmbean2-sar">
<copy file="${chapter.dir}/jmx-ex1xmbean2.sar" todir="${jboss.deploy.dir}"
overwrite="true" />
<sleep seconds="5"/>
<java classname="org.jboss.book.jmx.xmbean.TestXMBeanRestart" fork="true">
<classpath refid="chapter.path" />
</java>
</target>
<target name="run-examplexmbean3" depends="rmic,jmx-ex1xmbean3-sar">
<copy file="${chapter.dir}/jmx-ex1xmbean3.sar" todir="${jboss.deploy.dir}" />
<sleep seconds="5"/>
<java classname="org.jboss.book.jmx.xmbean.TestXMBean3" fork="true">
<classpath refid="chapter.path" />
</java>
</target>
<target name="run-example3" depends="jmx-ex3-ear">
<copy file="${chapter.dir}/jmx-ex3.ear" todir="${jboss.deploy.dir}"
overwrite="true" />
</target>
<target name="run-example4">
<property name="cp" refid="chapter.path" />
<java classname="org.jboss.book.jmx.ex4.JMXBrowser" fork="true">
<classpath refid="chapter.path" />
<classpath>
<pathelement location="${jboss.dist}/client/jbossall-client.jar" />
<pathelement location="${jboss.dist}/lib/dom4j.jar" />
</classpath>
</java>
</target>
</project>
1.1 date: 2006/11/01 18:14:13; author: nrichards; state: Exp;jboss-docs/jbossas/j2ee/examples/build-misc.xml
Index: build-misc.xml
===================================================================
<project name="misc examples build" default="build-all">
<property name="src.root" value="src/main/org/jboss/book/misc" />
<property name="chapter.dir" value="${build.dir}/misc"/>
<path id="chapter.path">
<pathelement location="src/main" />
<pathelement location="output/classes" />
<pathelement path="${client.path}" />
</path>
<target name="prepare">
<mkdir dir="${chapter.dir}"/>
</target>
<target name="build-all">
<antcall target="misc-ex2-sar" />
</target>
<target name="config">
</target>
<target name="misc-ex2-sar" depends="prepare">
<jar jarfile="${chapter.dir}/misc-ex2.sar">
<metainf dir="${src.root}/ex2" includes="jboss-service.xml"/>
<fileset dir="${build.classes.dir}">
<include name="org/jboss/book/misc/ex2/*" />
</fileset>
</jar>
</target>
<!-- Examples -->
<target name="run-example1">
<!-- Create a copy of default as jboss0 -->
<echo message="Preparing jboss0 configuration fileset"/>
<mkdir dir="${jboss.dist}/server/jboss0"/>
<copy todir="${jboss.dist}/server/jboss0">
<fileset dir="${jboss.dist}/server/default">
<exclude name="data/**"/>
<exclude name="deploy/chap*"/>
<exclude name="log/**"/>
<exclude name="tmp/**"/>
</fileset>
</copy>
<copy todir="${jboss.dist}/server/jboss0/conf" overwrite="true"
file="${src.root}/ex1/jboss-service.xml"/>
<copy todir="${jboss.dist}/server/"
file="${src.resources}/misc-ex1-bindings.xml"/>
<echo message="Preparing jboss1 configuration fileset"/>
<mkdir dir="${jboss.dist}/server/jboss1"/>
<copy todir="${jboss.dist}/server/jboss1">
<fileset dir="${jboss.dist}/server/jboss0">
<exclude name="data/**"/>
<exclude name="log/**"/>
<exclude name="tmp/**"/>
</fileset>
</copy>
</target>
<target name="run-example2" depends="misc-ex2-sar">
<copy file="${chapter.dir}/misc-ex2.sar" todir="${jboss.deploy.dir}"
overwrite="true" />
</target>
<target name="run-examplebind">
<java classname="org.jboss.book.misc.jndibind.Lookup"
classpathref="chapter.path" fork="true" />
</target>
</project>
1.1 date: 2006/11/01 18:14:13; author: nrichards; state: Exp;jboss-docs/jbossas/j2ee/examples/build-naming.xml
Index: build-naming.xml
===================================================================
<!-- Build script for the chapter 3 examples -->
<project name="Chapter 3 build" default="build-all">
<property name="src.root" value="src/main/org/jboss/naming" />
<property name="chapter.dir" value="${build.dir}/naming" />
<target name="build-all" depends="prepare" />
<target name="prepare">
</target>
<target name="config">
<echo message="Preparing naming configuration fileset" />
<mkdir dir="${jboss.dist}/server/naming" />
<copy todir="${jboss.dist}/server/naming">
<fileset dir="${jboss.dist}/server/default">
<exclude name="data/**"/>
<exclude name="log/**"/>
<exclude name="tmp/**"/>
</fileset>
</copy>
<copy file="${src.root}/../chap8/chap8.keystore" overwrite="true"
todir="${jboss.dist}/server/naming/conf" />
<!-- already has keystore
<copy file="${src.root}/jboss-service.xml" overwrite="true"
todir="${jboss.dist}/server/naming/conf" />
-->
<copy file="${src.root}/server.xml" overwrite="true"
tofile="${jboss.dist}/server/naming/deploy/jbossweb-tomcat55.sar/server.xml" />
<copy file="${src.root}/invoker-service.xml" overwrite="true"
tofile="${jboss.dist}/server/naming/deploy/http-invoker.sar/META-INF/jboss-service.xml" />
<copy file="${src.root}/invoker-web.xml" overwrite="true"
tofile="${jboss.dist}/server/naming/deploy/http-invoker.sar/invoker.war/WEB-INF/web.xml" />
</target>
<target name="run-example1">
<java classname="org.jboss.naming.ex1.ExClient" fork="true">
<classpath>
<pathelement path="${client.path}" />
<pathelement location="${jboss.dist}/lib/jboss-jmx.jar"/>
</classpath>
<jvmarg value="-Djavax.net.ssl.trustStore=${jboss.dist}/server/naming/conf/chap8.keystore" />
<jvmarg value="-Dorg.jboss.security.ignoreHttpsHost=true" />
</java>
</target>
</project>
1.1 date: 2006/11/01 18:14:13; author: nrichards; state: Exp;jboss-docs/jbossas/j2ee/examples/build-security.xml
Index: build-security.xml
===================================================================
<project name="security chapter examples" default="build-all">
<property name="src.root" value="src/main/org/jboss/book/security"/>
<property name="chapter.dir" value="${build.dir}/security"/>
<path id="chapter.path">
<pathelement location="src/main"/>
<pathelement path="${client.path}"/>
</path>
<target name="prepare">
<mkdir dir="${chapter.dir}"/>
</target>
<target name="config">
<!-- Setup a custom config for the ex3a examples -->
<echo message="Preparing security-ex3a configuration fileset"/>
<copy todir="${jboss.dist}/server/security-ex3a">
<fileset dir="${jboss.dist}/server/all">
<exclude name="db/**"/>
<exclude name="log/**"/>
<exclude name="tmp/**"/>
</fileset>
</copy>
<!-- Setup a custom config for the ex3b examples -->
<echo message="Preparing security-ex3b configuration fileset"/>
<copy todir="${jboss.dist}/server/security-ex3b">
<fileset dir="${jboss.dist}/server/all">
<exclude name="db/**"/>
<exclude name="log/**"/>
<exclude name="tmp/**"/>
</fileset>
</copy>
<copy file="${src.root}/ex3b/http-invoker-service.xml" overwrite="true" tofile="${jboss.dist}/server/security-ex3b/deploy/http-invoker.sar/META-INF/jboss-service.xml"/>
<copy file="${src.root}/ex3b/web.xml" overwrite="true" todir="${jboss.dist}/server/security-ex3b/deploy/http-invoker.sar/invoker.war/WEB-INF"/>
<replace file="${jboss.dist}/server/security-ex3b/deploy/jbossweb.sar/META-INF/jboss-service.xml">
<replacetoken><![CDATA[<mbean code="org.jboss.jetty.JettyService" name="jboss.web:service=JBossWeb">]]></replacetoken>
<replacevalue><![CDATA[<mbean code="org.jboss.jetty.JettyService" name="jboss.web:service=JBossWeb">
<depends>jboss:service=DefaultPartition</depends>]]></replacevalue>
</replace>
</target>
<target name="build-all">
<antcall target="security-ex1-jar"/>
<antcall target="security-ex2-jar"/>
<antcall target="security-ex3-jar"/>
<antcall target="security-ex3a-jar"/>
<antcall target="security-ex3b-jar"/>
<antcall target="security-ex4-jar"/>
</target>
<target name="security-ex1-sar" depends="prepare">
<jar jarfile="${chapter.dir}/security-ex1.sar">
<metainf dir="${src.root}/ex1" includes="jboss-service.xml"/>
<metainf dir="${src.root}" includes="login-config.xml"/>
<fileset dir="${build.classes.dir}" includes="org/jboss/book/security/service/*"/>
</jar>
</target>
<target name="security-ex1-jar" depends="security-ex1-sar">
<jar jarfile="${chapter.dir}/security-ex1.jar">
<metainf dir="${src.root}/ex1" includes="ejb-jar.xml,jboss.xml"/>
<fileset dir="${build.classes.dir}" includes="org/jboss/book/security/ex1/*" excludes="org/jboss/book/security/ex1/ExClient.class"/>
<fileset dir="${src.root}/ex1" includes="*.properties"/>
<fileset dir="${chapter.dir}" includes="security-ex1.sar"/>
</jar>
</target>
<target name="security-ex2-sar" depends="prepare">
<jar jarfile="${chapter.dir}/security-ex2.sar">
<metainf dir="${src.root}/ex2" includes="jboss-service.xml"/>
<metainf dir="${src.root}" includes="login-config.xml"/>
<fileset dir="${build.classes.dir}">
<include name="org/jboss/book/security/service/*"/>
<include name="org/jboss/book/security/ex2/service/*"/>
</fileset>
</jar>
</target>
<target name="security-ex2-jar" depends="security-ex2-sar">
<jar jarfile="${chapter.dir}/security-ex2.jar">
<metainf dir="${src.root}/ex2" includes="ejb-jar.xml,jboss.xml"/>
<fileset dir="${build.classes.dir}">
<include name="org/jboss/book/security/ex2/*"/>
<exclude name="org/jboss/book/security/ex1/ExClient.class"/>
</fileset>
<fileset dir="${chapter.dir}" includes="security-ex2.sar"/>
</jar>
</target>
<target name="security-ex3-sar" depends="prepare">
<jar jarfile="${chapter.dir}/security-ex3.sar">
<metainf dir="${src.root}/ex3" includes="jboss-service.xml"/>
<metainf dir="${src.root}" includes="login-config.xml"/>
<fileset dir="${build.classes.dir}">
<include name="org/jboss/book/security/service/*"/>
<include name="org/jboss/book/security/ex3/service/*"/>
</fileset>
</jar>
</target>
<target name="security-ex3-jar" depends="security-ex3-sar">
<jar jarfile="${chapter.dir}/security-ex3.jar">
<metainf dir="${src.root}/ex3" includes="ejb-jar.xml,jboss.xml"/>
<fileset dir="${build.classes.dir}" includes="org/jboss/book/security/ex3/*" excludes="org/jboss/book/security/ex3/ExClient*"/>
<fileset dir="${src.root}/ex3" includes="*.properties"/>
<fileset dir="${chapter.dir}" includes="security-ex3.sar"/>
</jar>
</target>
<target name="security-ex3a-sar" depends="prepare">
<jar jarfile="${chapter.dir}/security-ex3a.sar">
<metainf dir="${src.root}/ex3a" includes="jboss-service.xml"/>
<metainf dir="${src.root}" includes="login-config.xml"/>
<fileset dir="${build.classes.dir}">
<include name="org/jboss/book/security/service/*"/>
<include name="org/jboss/book/security/ex3/service/*"/>
<include name="org/jboss/book/security/ex3a/service/*"/>
</fileset>
</jar>
</target>
<target name="security-ex3a-jar" depends="security-ex3a-sar">
<jar jarfile="${chapter.dir}/security-ex3a.jar">
<metainf dir="${src.root}/ex3a" includes="ejb-jar.xml,jboss.xml"/>
<fileset dir="${build.classes.dir}"
includes="org/jboss/book/security/ex3a/*" excludes="org/jboss/book/security/ex3a/ExClient*"/>
<fileset dir="${src.root}/ex3a" includes="*.properties"/>
<fileset dir="${chapter.dir}" includes="security-ex3a.sar"/>
</jar>
</target>
<target name="security-ex3b-sar" depends="prepare">
<jar jarfile="${chapter.dir}/security-ex3b.sar">
<metainf dir="${src.root}/ex3b" includes="jboss-service.xml"/>
<metainf dir="${src.root}" includes="login-config.xml"/>
<fileset dir="${build.classes.dir}">
<include name="org/jboss/book/security/service/*"/>
<include name="org/jboss/book/security/ex3/service/*"/>
<include name="org/jboss/book/security/ex3a/service/*"/>
</fileset>
</jar>
</target>
<target name="security-ex3b-jar" depends="security-ex3b-sar">
<jar jarfile="${chapter.dir}/security-ex3b.jar">
<metainf dir="${src.root}/ex3a" includes="ejb-jar.xml,jboss.xml"/>
<fileset dir="${build.classes.dir}"
includes="org/jboss/book/security/ex3a/*" excludes="org/jboss/book/security/ex3a/ExClient*"/>
<fileset dir="${src.root}/ex3a" includes="*.properties"/>
<fileset dir="${chapter.dir}" includes="security-ex3b.sar"/>
</jar>
</target>
<target name="security-ex4-sar" depends="prepare">
<jar jarfile="${chapter.dir}/security-ex4.sar">
<metainf dir="${src.root}/ex4" includes="jboss-service.xml"/>
<fileset dir="${src.root}">
<include name="example.keystore"/>
</fileset>
</jar>
</target>
<target name="security-ex4-jar" depends="security-ex4-sar">
<jar jarfile="${chapter.dir}/security-ex4.jar">
<metainf dir="${src.root}/ex4" includes="ejb-jar.xml,jboss.xml"/>
<fileset dir="${build.classes.dir}">
<include name="org/jboss/book/security/ex4/*"/>
<exclude name="org/jboss/book/security/ex4/ExClient.class"/>
<exclude name="org/jboss/book/security/ex4/JSSE_install_check.class"/>
</fileset>
<fileset dir="${chapter.dir}" includes="security-ex4.sar"/>
</jar>
</target>
<!-- Examples -->
<target name="run-example1" depends="security-ex1-jar">
<copy file="${chapter.dir}/security-ex1.jar"
todir="${jboss.deploy.dir}" overwrite="true" />
<echo message="Waiting for 5 seconds for deploy..." />
<sleep seconds="5" />
<java classname="org.jboss.book.security.ex1.ExClient"
classpathref="chapter.path" fork="true">
<jvmarg value="-Djava.security.manager" />
<jvmarg value="-Djava.security.policy=${src.resources}/app.policy"/>
</java>
</target>
<target name="run-example2" depends="security-ex2-jar">
<copy file="${chapter.dir}/security-ex2.jar" todir="${jboss.deploy.dir}" overwrite="true"/>
<echo message="Waiting for 5 seconds for deploy..."/>
<sleep seconds="5"/>
<java classname="org.jboss.book.security.ex2.ExClient"
classpathref="chapter.path" fork="true">
<jvmarg value="-Djava.security.manager"/>
<jvmarg value="-Djava.security.policy=${src.resources}/app.policy"/>
<jvmarg value="-Djava.security.auth.login.config=${src.resources}/auth.conf"/>
<arg value="jduke"/>
<arg value="theduke"/>
</java>
</target>
<target name="run-example3" depends="security-ex3-jar">
<copy file="${chapter.dir}/security-ex3.jar" todir="${jboss.deploy.dir}" overwrite="true"/>
<echo message="Waiting for 5 seconds for deploy..."/>
<sleep seconds="5"/>
<java classname="org.jboss.book.security.ex3.ExClient"
classpathref="chapter.path" fork="true">
<jvmarg value="-Djava.security.manager"/>
<jvmarg value="-Djava.security.policy=${src.resources}/app.policy"/>
<jvmarg value="-Djava.security.auth.login.config=${src.resources}/auth.conf"/>
<arg value="jduke"/>
<arg value="theduke"/>
</java>
</target>
<target name="run-example3a" depends="security-ex3a-jar">
<echo message="The ${chapter.dir}/security-ex3a.jar must have been deployed to the cluster"/>
<java classname="org.jboss.book.security.ex3a.ExClient"
classpathref="chapter.path" fork="true">
<jvmarg value="-Djava.security.manager"/>
<jvmarg value="-Djava.security.policy=${src.resources}/app.policy"/>
<jvmarg value="-Djava.security.auth.login.config=${src.resources}/auth.conf"/>
<arg value="jduke"/>
<arg value="theduke"/>
</java>
</target>
<target name="run-example3b" depends="security-ex3b-jar">
<echo message="The ${chapter.dir}/security-ex3b.jar must have been deployed to the cluster and -c security-ex3b"/>
<java classname="org.jboss.book.security.ex3b.ExClient"
classpathref="chapter.path" fork="true">
<jvmarg value="-Djava.security.manager"/>
<jvmarg value="-Djava.security.policy=${src.resources}/app.policy"/>
<jvmarg value="-Djava.security.auth.login.config=${src.resources}/auth.conf"/>
<arg value="jduke"/>
<arg value="theduke"/>
</java>
</target>
<target name="run-example3bro">
<echo message="The ${chapter.dir}/security-ex3b.jar must have been deployed to the cluster and -c security-ex3b"/>
<java classname="org.jboss.book.security.ex3b.TstReadOnly"
classpathref="chapter.path" fork="true">
<jvmarg value="-Djava.security.manager"/>
<jvmarg value="-Djava.security.policy=${src.resources}/app.policy"/>
<jvmarg value="-Djava.security.auth.login.config=${src.resources}/auth.conf"/>
</java>
</target>
<target name="run-example4a" depends="security-ex4-jar">
<echo message="Testing JSSE availablility"/>
<java classname="org.jboss.book.security.ex4.JSSE_install_check"
classpathref="chapter.path" fork="true">
<jvmarg value="-Djava.security.manager"/>
<jvmarg value="-Djava.security.policy=${src.resources}/app.policy"/>
<jvmarg value="-Djavax.net.debug=all"/>
</java>
</target>
<target name="run-example4b" depends="security-ex4-jar">
<copy file="${chapter.dir}/security-ex4.jar" todir="${jboss.deploy.dir}" overwrite="true"/>
<echo message="Waiting for 15 seconds for deploy..."/>
<sleep seconds="15"/>
<java classname="org.jboss.book.security.ex4.ExClient"
classpathref="chapter.path" fork="true">
<jvmarg value="-Djava.security.manager"/>
<jvmarg value="-Djava.security.policy=${src.resources}/app.policy"/>
<jvmarg value="-Djavax.net.debug=trustmanager"/>
</java>
</target>
<target name="run-example4" depends="security-ex4-jar">
<copy file="${chapter.dir}/security-ex4.jar" todir="${jboss.deploy.dir}" overwrite="true"/>
<echo message="Waiting for 5 seconds for deploy..."/>
<sleep seconds="5"/>
<java classname="org.jboss.book.security.ex4.ExClient"
classpathref="chapter.path" fork="true">
<jvmarg value="-Djava.security.manager"/>
<jvmarg value="-Djava.security.policy=${src.resources}/app.policy"/>
<jvmarg value="-Djavax.net.ssl.trustStore=${src.root}/example.keystore"/>
</java>
</target>
</project>
1.1 date: 2006/11/01 18:14:13; author: nrichards; state: Exp;jboss-docs/jbossas/j2ee/examples/build.xml
Index: build.xml
===================================================================
<?xml version="1.0" encoding="UTF-8" ?>
<!--
JBoss 4 Application Server Guide
$Revision: 1.1 $
-->
<project name="JBoss book examples" default="build-all" basedir=".">
<!-- Allow overrides from a local properties file -->
<property file="ant.properties" />
<!-- Override with your JBoss server bundle dist location -->
<property name="jboss.dist" value="jboss-4.0.5.GA" />
<property name="jboss.deploy.conf" value="default" />
<property name="jboss.deploy.dir" value="${jboss.dist}/server/${jboss.deploy.conf}/deploy" />
<property name="src.dir" value="${basedir}/src/main" />
<property name="src.resources" value="${basedir}/src/resources" />
<property name="lib.dir" value="${basedir}/lib" />
<property name="build.dir" value="${basedir}/output" />
<property name="build.src.dir" value="${basedir}/output/gen-src" />
<property name="build.classes.dir" value="${build.dir}/classes" />
<path id="build.path">
<pathelement location="${jboss.dist}/client/concurrent.jar" />
<pathelement location="${jboss.dist}/client/jbossall-client.jar" />
<pathelement location="${jboss.dist}/client/jbossws14-client.jar" />
<pathelement location="${jboss.dist}/client/jnet.jar" />
<pathelement location="${jboss.dist}/client/jnp-client.jar" />
<pathelement location="${jboss.dist}/client/jsse.jar" />
<pathelement location="${jboss.dist}/client/log4j.jar" />
<pathelement location="${jboss.dist}/server/default/lib/javax.servlet.jar" />
<pathelement location="${jboss.dist}/server/default/lib/jboss.jar" />
<pathelement location="${jboss.dist}/server/default/lib/jbosssx.jar" />
<pathelement location="${jboss.dist}/server/default/lib/scheduler-plugin.jar" />
<pathelement location="${jboss.dist}/server/all/lib/jbossha.jar" />
<pathelement location="${jboss.dist}/lib/jboss-system.jar" />
<pathelement location="${jboss.dist}/lib/jboss-jmx.jar" />
<pathelement location="${lib.dir}/junit.jar" />
<pathelement location="${build.classes.dir}" />
</path>
<path id="client.path">
<pathelement location="${src.resources}" />
<fileset dir="${jboss.dist}/client">
<include name="**/*.jar" />
</fileset>
<pathelement location="${build.classes.dir}" />
</path>
<!--
Validate the jboss.dist value by looking for a the client/jboss-j2ee.jar jar
-->
<target name="validate">
<available property="classpath_id" value="build.path" file="${jboss.dist}/client/jboss-j2ee.jar" />
</target>
<target name="fail_if_not_valid" unless="classpath_id">
<fail message="jboss.dist=${jboss.dist} is not a valid JBoss dist directory" />
</target>
<target name="init" depends="validate,fail_if_not_valid">
<property name="classpath" refid="${classpath_id}" />
<echo message="Using jboss.dist=${jboss.dist}" />
<mkdir dir="logs" />
</target>
<!-- Compile all java source under src/main -->
<target name="compile" depends="init">
<mkdir dir="${build.classes.dir}" />
<mkdir dir="${build.src.dir}" />
<javac srcdir="${src.dir}"
destdir="${build.classes.dir}"
debug="on" deprecation="on"
optimize="off">
<classpath>
<path refid="build.path" />
</classpath>
<src path="${build.src.dir}" />
<!-- <include name="ListJar.java" /> -->
<include name="org/jboss/**" />
</javac>
</target>
<target name="build-all" depends="compile">
<ant antfile="build-jmx.xml" />
<ant antfile="build-naming.xml" />
<ant antfile="build-jms.xml" />
<ant antfile="build-jca.xml" />
<ant antfile="build-security.xml" />
<ant antfile="build-misc.xml" />
</target>
<target name="build-chap" depends="compile">
<ant antfile="build-${chap}.xml" />
</target>
<!-- Use -Dchap=N to run chapN-config -->
<target name="config" depends="compile">
<property name="client.path" refid="client.path" />
<ant antfile="build-${chap}.xml" inheritRefs="true" target="config" />
</target>
<!-- Use -Dchap=N -Dex=M to run chapN-exampleM -->
<target name="run-example" depends="compile">
<property name="client.path" refid="client.path" />
<ant antfile="build-${chap}.xml" inheritRefs="true" target="run-example${ex}" />
</target>
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="logs" />
</target>
</project>
More information about the jboss-cvs-commits
mailing list