Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 19 files changed
  • 0 commit comments
  • 1 contributor
Showing with 2,365 additions and 0 deletions.
  1. +51 −0 modules/sun/internal/saaj/main/module.xml
  2. +5 −0 modules/sun/internal/saaj/main/service-loader-resources/META-INF/service/MANIFEST.MF
  3. +1 −0  ...les/sun/internal/saaj/main/service-loader-resources/META-INF/service/services/javax.xml.soap.MessageFactory
  4. +1 −0  modules/sun/internal/saaj/main/service-loader-resources/META-INF/service/services/javax.xml.soap.MetaFactory
  5. +1 −0  .../internal/saaj/main/service-loader-resources/META-INF/service/services/javax.xml.soap.SOAPConnectionFactory
  6. +18 −0 saajTest.ear/META-INF/application.xml
  7. +33 −0 saajTest.ear/META-INF/jboss-deployment-structure.xml
  8. +5 −0 saajTest.ear/README.md
  9. +2 −0  saajTest.ear/build.properties
  10. +729 −0 saajTest.ear/build.xml
  11. BIN  saajTest.ear/lib/saajOverride.jar
  12. 0  saajTest.ear/saajTest.jar/META-INF/MANIFEST.MF
  13. +2 −0  saajTest.ear/saajTest.jar/build.properties
  14. +729 −0 saajTest.ear/saajTest.jar/build.xml
  15. +31 −0 saajTest.ear/saajTest.jar/com/redhat/gss/saaj/EjbSaajTest.java
  16. 0  saajTest.ear/saajTest.war/META-INF/MANIFEST.MF
  17. +26 −0 saajTest.ear/saajTest.war/WEB-INF/classes/com/redhat/gss/saaj/SaajTest.java
  18. +2 −0  saajTest.ear/saajTest.war/build.properties
  19. +729 −0 saajTest.ear/saajTest.war/build.xml
View
51 modules/sun/internal/saaj/main/module.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2010, Red Hat, Inc., and individual contributors
+ ~ as indicated by the @author tags. See the copyright.txt file in the
+ ~ distribution for a full listing of individual contributors.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+<module xmlns="urn:jboss:module:1.1" name="sun.internal.saaj">
+ <resources>
+ <resource-root path="service-loader-resources"/>
+ </resources>
+ <dependencies>
+ <system export="true">
+ <paths>
+ <path name="com/sun/xml/internal/messaging/saaj/"/>
+ <path name="com/sun/xml/internal/messaging/saaj/client/p2p/"/>
+ <path name="com/sun/xml/internal/messaging/saaj/packaging/mime/"/>
+ <path name="com/sun/xml/internal/messaging/saaj/packaging/mime/internet/"/>
+ <path name="com/sun/xml/internal/messaging/saaj/packaging/mime/util/"/>
+ <path name="com/sun/xml/internal/messaging/saaj/soap/"/>
+ <path name="com/sun/xml/internal/messaging/saaj/soap/dynamic/"/>
+ <path name="com/sun/xml/internal/messaging/saaj/soap/impl/"/>
+ <path name="com/sun/xml/internal/messaging/saaj/soap/name/"/>
+ <path name="com/sun/xml/internal/messaging/saaj/soap/ver1_1/"/>
+ <path name="com/sun/xml/internal/messaging/saaj/soap/ver1_2/"/>
+ <path name="com/sun/xml/internal/messaging/saaj/util/"/>
+ <path name="com/sun/xml/internal/messaging/saaj/util/transform/"/>
+ </paths>
+ <exports>
+ <include-set>
+ <path name="META-INF/services"/>
+ </include-set>
+ </exports>
+ </system>
+ </dependencies>
+</module>
View
5 modules/sun/internal/saaj/main/service-loader-resources/META-INF/service/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Ant-Version: Apache Ant 1.8.2
+Created-By: 1.6.0_31-b04-413-11M3623 (Apple Inc.)
+Class-Path:
+
View
1  ...aaj/main/service-loader-resources/META-INF/service/services/javax.xml.soap.MessageFactory
@@ -0,0 +1 @@
+com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl
View
1  ...l/saaj/main/service-loader-resources/META-INF/service/services/javax.xml.soap.MetaFactory
@@ -0,0 +1 @@
+com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl
View
1  ...n/service-loader-resources/META-INF/service/services/javax.xml.soap.SOAPConnectionFactory
@@ -0,0 +1 @@
+com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnectionFactory
View
18 saajTest.ear/META-INF/application.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ To the extent possible under law, Red Hat, Inc. has dedicated all copyright
+ to this software to the public domain worldwide, pursuant to the CC0 Public
+ Domain Dedication. This software is distributed without any warranty. See
+ <http://creativecommons.org/publicdomain/zero/1.0/>.
+-->
+<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">
+ <module>
+ <web>
+ <web-uri>saajTest.war</web-uri>
+ <context-root>/saajTest</context-root>
+ </web>
+ </module>
+ <module>
+ <ejb>saajTest.jar</ejb>
+ </module>
+</application>
View
33 saajTest.ear/META-INF/jboss-deployment-structure.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ To the extent possible under law, Red Hat, Inc. has dedicated all copyright
+ to this software to the public domain worldwide, pursuant to the CC0 Public
+ Domain Dedication. This software is distributed without any warranty. See
+ <http://creativecommons.org/publicdomain/zero/1.0/>.
+-->
+<jboss-deployment-structure>
+ <ear-subdeployments-isolated>false</ear-subdeployments-isolated>
+ <sub-deployment name="saajTest.jar">
+ <exclusions>
+ <module name="org.jboss.ws.saaj-impl"/>
+ </exclusions>
+ <dependencies>
+ <module name="sun.internal.saaj"/>
+ <module name="org.jboss.modules"/>
+ </dependencies>
+ </sub-deployment>
+ <sub-deployment name="saajTest.war">
+ <exclusions>
+ <module name="org.apache.log4j"/>
+ <module name="org.hibernate"/>
+ <!--<module name="javaee.api"/>-->
+ <module name="com.sun.xml.messaging.saaj"/>
+ <module name="javax.xml.soap.api"/>
+ <module name="org.jboss.ws.saaj-impl"/>
+ <module name="javax.activation.api"/>
+ </exclusions>
+ <dependencies>
+ <module name="org.jboss.modules"/>
+ </dependencies>
+ </sub-deployment>
+</jboss-deployment-structure>
View
5 saajTest.ear/README.md
@@ -0,0 +1,5 @@
+###Make a deployment use JDK SAAJ
+
+This is an experiment to figure out how to make a deployment in EAP 6 use the SAAJ implementation found in the JDK.
+
+Make sure to copy the `sun.internal.saaj` module to your `$JBOSS_HOME/modules` directory.
View
2  saajTest.ear/build.properties
@@ -0,0 +1,2 @@
+test-client=
+auth-conf=${basedir}/auth.conf
View
729 saajTest.ear/build.xml
@@ -0,0 +1,729 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ To the extent possible under law, Red Hat, Inc. has dedicated all copyright
+ to this software to the public domain worldwide, pursuant to the CC0 Public
+ Domain Dedication. This software is distributed without any warranty. See
+ <http://creativecommons.org/publicdomain/zero/1.0/>.
+-->
+<!--
+author: Brad Maxwell
+Simplified Build
+version 0.4 May 28, 2010
+Added Help
+Adding custom lib directory in build.properties
+-->
+
+<project name="simplified-build" default="all">
+ <!-- ===== PROPERTIES ===== -->
+ <property environment="env"/>
+ <!-- <basename property="dirName" file="${env.PWD}"/> -->
+ <!-- <dirname property="script-dir" file="${ant.file.main}"/> --> <!-- same as env.BUILD_SCRIPTS -->
+
+ <basename property="dirName" file="${basedir}"/>
+
+ <!-- <available property="unified-build-exists" file="${basedir}/unified-build.xml" value="true"/> -->
+ <property name="parentDir" location="${basedir}/.."/>
+
+ <property file="build.properties"/> <!-- Include build.properties -->
+
+ <!-- environment variables that need to be set -->
+ <condition property="jboss-home" value="${JBOSS_HOME}" else="${env.JBOSS_HOME}"><isset property="JBOSS_HOME"/></condition>
+
+ <!-- init method will verify they are set -->
+
+ <!-- AS7 / EAP6 -->
+ <available file="${jboss-home}/modules" property="AS7"/>
+
+ <!-- use default if env.JBOSS_PROFILE is not set and not specified in build.properties -->
+ <condition property="JBOSS_PROFILE" value="standalone" else="default"><isset property="AS7"/></condition>
+
+ <!-- <condition property="jboss-server" value="${JBOSS_PROFILE}" else="${env.JBOSS_PROFILE}"><isset property="JBOSS_PROFILE"/></condition> -->
+ <condition property="jboss-server" value="${env.JBOSS_PROFILE}" else="${JBOSS_PROFILE}"><isset property="env.JBOSS_PROFILE"/></condition>
+
+
+ <condition property="jboss-server-dir" value="${jboss-home}/${jboss-server}" else="${jboss-home}/server/${jboss-server}"><isset property="AS7"/></condition>
+
+ <condition property="jboss-deploy-dir" value="${jboss-server-dir}/deployments/" else="${jboss-server-dir}/deploy/"><isset property="AS7"/></condition>
+ <!-- <property name="jboss-endorsed-dir" location="${jboss-home}/lib/endorsed/"/> -->
+
+ <condition property="lib" value="${jboss-home}/modules/" else="${jboss-server-dir}/lib"><isset property="AS7"/></condition>
+ <property name="ant.project.name" value="${dirName}" />
+ <property name="archive.name" value="${dirName}" />
+ <property name="dist" value="dist"/>
+
+ <condition property="debuglevel" value="${debuglevel}" else="lines,vars,source"><isset property="debuglevel"/></condition>
+ <condition property="debug" value="${debug}" else="on"><isset property="debug"/></condition>
+
+ <!-- can set property, then use condition value="", if condition is not satisfied, it will not change the property -->
+
+ <!-- ===== ARCHIVE-TYPE ===== -->
+ <condition property="archive-type" value="jar"><matches string="${dirName}" pattern="^.*\.jar$"/></condition>
+ <condition property="archive-type" value="sar"><matches string="${dirName}" pattern="^.*\.sar$"/></condition>
+ <condition property="archive-type" value="war"><matches string="${dirName}" pattern="^.*\.war$"/></condition>
+ <condition property="archive-type" value="ear"><matches string="${dirName}" pattern="^.*\.ear$"/></condition>
+ <condition property="archive-type" value="aop"><matches string="${dirName}" pattern="^.*\.aop$"/></condition>
+ <condition property="archive-type" value="beans"><matches string="${dirName}" pattern="^.*\.beans$"/></condition>
+
+ <!-- this is the name of the ear/war/jar/... without the extension -->
+ <basename property="archive-name" file="${basedir}" suffix=".${archive-type}"/>
+
+ <!-- this property checks to see if it is an ear, and if so it will prevent the build target being called on the ear -->
+ <condition property="build" value="true">
+ <not><matches string="${archive-type}" pattern="ear"/></not>
+ </condition>
+
+ <!-- used to determine if ear needs to be packaged -->
+ <condition property="ear" value="true">
+ <matches string="${archive-type}" pattern="ear"/>
+ </condition>
+
+<!--
+ <condition property="manifest-class-path" value=""><not><isset property="manifest-class-path"/></not></condition>
+-->
+ <condition property="main-class" value=""><not><isset property="main-class"/></not></condition>
+
+ <condition property="earLib" value="${parentDir}/lib/" else="">
+ <and>
+ <matches string="${parentDir}" pattern="^.*\.ear$"/>
+ <available file="${parentDir}/lib" type="dir"/>
+ </and>
+ </condition>
+
+ <condition property="apiJarEarLib" value="../" else="">
+ <!-- for api-jar in lib dir -->
+ <and>
+ <!-- <matches string="${parentDir}" pattern="^.*/lib$"/> --> <!-- TODO this doesn't work on win -->
+ <matches string="${dirName}" pattern="^.*-api.jar$"/>
+ </and>
+ </condition>
+
+ <condition property="buildPath" value="WEB-INF/classes" else="">
+ <matches string="${archive-type}" pattern="^war$"/>
+ </condition>
+ <condition property="buildPath" value="" else=".">
+ <matches string="${archive-type}" pattern="^ear$"/>
+ </condition>
+
+ <!-- this should be . if in ear or .. if in sub dir -->
+ <condition property="ear-sub-archives-dir" value="." else="..">
+ <matches string="${archive-type}" pattern="^ear$"/>
+ </condition>
+ <condition property="ear-lib-dir" value="./lib" else="../lib">
+ <matches string="${archive-type}" pattern="^ear$"/>
+ </condition>
+
+ <condition property="include-build-classpath" value="">
+ <not><isset property="include-build-classpath"/></not>
+ </condition>
+
+ <!-- ===== PATHS / SETS ===== -->
+
+ <fileset dir="${basedir}" id="war.package.fileset">
+ <exclude name="**/*.java"/>
+ <exclude name="dist/"/>
+ <exclude name="build.xml"/>
+ <exclude name="build.properties"/>
+ <exclude name=".*"/>
+ </fileset>
+
+ <fileset dir="${basedir}" id="jar.package.fileset">
+ <exclude name="**/*.java"/>
+ <exclude name="bin/"/>
+ <exclude name="dist/"/>
+ <exclude name="build.xml"/>
+ <exclude name="build.properties"/>
+ </fileset>
+
+ <path id="classpath">
+ <!-- <path refid="user-classpath"/> -->
+ <pathelement location="${buildPath}" />
+
+ <fileset dir="${include-build-classpath}" includes="**/*.jar"/>
+
+ <dirset dir="${earLib}">
+ <include name="*-api.jar"/>
+ </dirset>
+
+ <!-- include jar,sar,war buildpaths in classpath -->
+ <dirset dir="${ear-sub-archives-dir}">
+ <include name="*.jar"/>
+ <include name="*.sar"/>
+ <include name="*.war/WEB-INF/classes"/>
+ </dirset>
+
+<!-- duplicate
+ <fileset dir="${ear-sub-archives-dir}">
+ <include name="*.jar"/>
+ </fileset>
+-->
+
+ <fileset dir="${jboss-home}/" includes="common/lib/**/*.jar"/> <!-- eap 5 -->
+ <fileset dir="${jboss-home}/" includes="lib/**/*.jar"/>
+ <fileset dir="${jboss-home}/" includes="client/**/*.jar"/>
+ <fileset dir="${jboss-home}/" includes="jboss-modules.jar"/> <!-- eap6 -->
+ <fileset dir="${jboss-server-dir}/" includes="lib/**/*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="**/jsf*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="**/portal-*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="**/portlet-*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="*jboss-portal*/**/*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="*ejb3.deployer*/**/*.jar"/>
+ <fileset dir="${jboss-server-dir}/" includes="deployers/**/*.jar"/>
+
+ <!-- if parent dir is an EAR and contains a lib dir then add to classpath -->
+ <fileset dir="${earLib}">
+ <type type="file"/>
+ <include name="**/*.jar"/>
+ </fileset>
+ <fileset dir="${apiJarEarLib}">
+ <include name="**/*.jar"/>
+ </fileset>
+
+ <!-- add support for lib declared in build.properties -->
+ <fileset dir="${lib}">
+ <include name="**/*.jar"/>
+ </fileset>
+
+ </path>
+
+ <!-- =============================== -->
+ <path id="ordered-dirs">
+ <fileset dir="${basedir}" includes="lib/*-api.jar/build.xml" id="lib-api-dirs"/>
+ <fileset dir="${basedir}" includes="lib/*.jar/build.xml" excludes="*-api.jar/build.xml" id="lib-api-dirs2"/>
+ <fileset dir="${basedir}" includes="*-api.jar/build.xml" id="api-dirs"/>
+ <fileset dir="${basedir}" includes="*.jar/build.xml" id="jar-dirs">
+ <and>
+ <filename name="*.jar/build.xml"/>
+ <filename name="*-api.jar/build.xml" negate="true"/>
+ <filename name="*-ejb.jar/build.xml" negate="true"/>
+ </and>
+ </fileset>
+ <fileset dir="${basedir}" includes="*.sar/build.xml" id="sar-dirs"/>
+ <fileset dir="${basedir}" includes="*-ejb.jar/build.xml" id="ejb-dirs"/>
+ <fileset dir="${basedir}" includes="*.aop/build.xml" id="aop-dirs"/>
+ <fileset dir="${basedir}" includes="*.war/build.xml" id="war-dirs"/>
+ </path>
+
+<!-- =============================== -->
+
+ <!-- ===== MACRODEFS ===== -->
+ <macrodef name="iterate">
+ <attribute name="target"/>
+ <sequential>
+ <subant target="@{target}" inheritall="false" inheritrefs="false" verbose="false">
+ <!-- <reference refid="user-classpath" torefid="user-classpath"/> -->
+ <property name="caller" location="."/>
+ <property name="main.build" location="${ant.file.main}"/>
+ <path refid="ordered-dirs"/>
+ </subant>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="check-env-set">
+ <attribute name="var"/>
+ <sequential>
+ <fail message="Please set the environment variable @{var}" unless="@{var}"/>
+ </sequential>
+ </macrodef>
+
+
+ <!-- ===== TARGETS ===== -->
+
+ <!-- [SB2] requires inits for everything -->
+ <!-- BEGIN OF INITS -->
+ <!-- this property will allow only *-init methods needed to be created, all other will direct to jar-init -->
+ <condition property="init-type" value="jar" else="${archive-type}"><not><matches string="${archive-type}" pattern="^[ew]ar$"/></not></condition>
+
+ <macrodef name="init">
+ <sequential>
+ <check-env-set var="env.JBOSS_HOME"/>
+ <check-env-set var="jboss-server"/>
+
+ <echo>Running ${archive-type} build scripts : ${ant.file}</echo>
+ <fail message="Unable to build ${dirName}. It should be a jar, war, ear, ..."
+ unless="archive-type"/>
+
+ <antcall target="${init-type}-init"/>
+ </sequential>
+ </macrodef>
+
+ <target name="ear-init">
+ <!-- [SB1] - create ear's META-INF & lib & touch application.xml if it does not exist -->
+ <!-- moved to ear-init instead of package, because war build requires war-init to be called before packaging & all builds use jar build now -->
+ <mkdir dir="${basedir}/META-INF/"/>
+ <mkdir dir="${basedir}/lib/"/>
+ <touch file="${basedir}/META-INF/application.xml"/>
+ </target>
+
+ <target name="jar-init">
+ <mkdir dir="${basedir}/META-INF/"/>
+ <touch file="${basedir}/META-INF/MANIFEST.MF"/>
+ </target>
+
+ <target name="war-init">
+ <!-- [SB2] - create WEB-INF/classes, WEB-INF/lib if it does not exist -->
+ <mkdir dir="${basedir}/META-INF/"/>
+ <mkdir dir="${basedir}/WEB-INF/classes/"/>
+ <mkdir dir="${basedir}/WEB-INF/lib/"/>
+ <touch file="${basedir}/META-INF/MANIFEST.MF"/>
+ </target>
+
+ <!-- END OF INITS -->
+
+ <target name="all">
+ <antcall target="build"/>
+ <antcall target="package"/>
+ </target>
+
+ <target name="clean">
+ <init/>
+
+ <delete dir="dist" includeemptydirs="true" quiet="true"/>
+
+ <delete verbose="true">
+ <fileset dir="." includes="**/*.class" />
+ </delete>
+
+ <!-- <antcall target="${archive-type}-clean"/> --> <!-- Removed individual cleans -->
+
+ <iterate target="clean"/>
+ </target>
+
+ <target name="build" if="build">
+ <build/>
+ <!-- <property name="build" value="false"/> -->
+ </target>
+
+ <macrodef name="build">
+ <sequential>
+ <init/>
+ <iterate target="build"/>
+
+<!-- <antcall target="${archive-type}-build"/> -->
+
+ <!-- everything except war and ear -->
+<!--
+ <property name="srcpath" value="${basedir}"/>
+ <property name="destdir" value="${basedir}"/>
+-->
+
+ <!-- if war -->
+<!--
+ <property name="srcpath" value="${basedir}/WEB-INF/classes"/>
+ <property name="destdir" value="${basedir}/WEB-INF/classes"/>
+-->
+
+ <condition property="srcpath" value="${basedir}/WEB-INF/classes" else="${basedir}"><matches string="${archive-type}" pattern="war"/></condition>
+ <condition property="destdir" value="${basedir}/WEB-INF/classes" else="${basedir}"><matches string="${archive-type}" pattern="war"/></condition>
+
+ <echo>PROPS: ${srcpath} ${destdir}</echo>
+
+ <javac destdir="${destdir}" debug="${debug}" debuglevel="${debuglevel}">
+ <src path="${srcpath}"/>
+ <classpath refid="classpath"/>
+ </javac>
+ </sequential>
+ </macrodef>
+
+ <target name="package" depends="build">
+ <mkdir dir="dist"/>
+ <iterate target="package"/>
+
+ <antcall target="${archive-type}-package"/>
+
+ </target>
+
+<!-- JAR Build -->
+
+<!--
+ <target name="jar-build">
+ <sequential>
+ <javac destdir="." debug="${debug}" debuglevel="${debuglevel}">
+ <src path="${basedir}"/>
+ <classpath refid="classpath"/>
+ </javac>
+ </sequential>
+ </target>
+-->
+ <target name="jar-package">
+ <jar-package/>
+ </target>
+
+ <target name="aop-package">
+ <jar-package/>
+ </target>
+
+ <target name="beans-package">
+ <jar-package/>
+ </target>
+
+ <target name="sar-package">
+ <jar-package/>
+ </target>
+
+ <macrodef name="jar-package">
+ <sequential>
+<!--
+ <manifest file="META-INF/MANIFEST.MF" mode="update">
+ <attribute name="Class-Path" value="${manifest-class-path}"/>
+ <attribute name="Main-Class" value="${main-class}"/>
+ </manifest>
+-->
+
+ <jar destfile="dist/${archive.name}" manifest="META-INF/MANIFEST.MF">
+ <fileset refid="jar.package.fileset"/>
+ </jar>
+ </sequential>
+ </macrodef>
+
+<!-- WAR -->
+<!--
+ <target name="war-all" depends="war-build, war-package"> </target>
+
+ <target name="war-clean"> </target>
+-->
+
+ <target name="war-build">
+
+ <javac destdir="WEB-INF/classes/" debug="${debug}" debuglevel="${debuglevel}">
+ <src path="WEB-INF/classes"/>
+ <classpath refid="classpath"/>
+ </javac>
+ </target>
+
+ <target name="war-package">
+ <mkdir dir="dist"/>
+
+<!--
+ <manifest file="META-INF/MANIFEST.MF" mode="update">
+ <attribute name="Class-Path" value="${manifest-class-path}"/>
+ </manifest>
+-->
+
+
+ <war destfile="dist/${archive.name}" needxmlfile="false" manifest="META-INF/MANIFEST.MF">
+ <fileset refid="war.package.fileset"/>
+ </war>
+ </target>
+
+<!-- SAR & rar same as jar-->
+
+<!-- EAR -->
+ <uptodate property="ear-package.notrequired" targetfile="dist/${archive.name}" >
+ <srcfiles dir= "${basedir}" includes="**/dist/*"/>
+ </uptodate>
+
+ <target name="ear-all" depends="">
+ <echo>Calling sub archives build</echo>
+ <!--<antcall target="ear-build"/>-->
+ <antcall target="ear-package"/>
+ </target>
+
+<!--
+ <target name="ear-build">
+ </target>
+-->
+
+ <target name="ear-package" if="ear">
+ <sequential>
+ <!-- call it here, b/c ear does not have build called on it, putting it in package would be duplicated by the depends=build -->
+ <init/>
+ <!-- call herre, b/c depends would delete the dist files before checking ear-package.notrequired -->
+ <delete dir="dist" includeemptydirs="true" quiet="true" includes="**/*"/>
+
+ <mkdir dir="packaging"/>
+ <mkdir dir="packaging/lib/"/>
+
+ <copy flatten="true" todir="packaging">
+ <fileset dir="${basedir}">
+ <include name="*/dist/*"/>
+ </fileset>
+ </copy>
+
+ <copy flatten="true" todir="packaging/lib/">
+ <fileset dir="${basedir}/lib">
+ <include name="*.jar/dist/*.jar"/> <!-- include dirs *.jar/dist/*.jar and any jar files in the lib -->
+ <include name="*.jar"/>
+ <type type="file"/>
+ </fileset>
+ </copy>
+
+ <ear destfile="dist/${archive.name}" appxml="META-INF/application.xml">
+<!--
+ <manifest>
+ <attribute name="Class-Path" value="${manifest-class-path}"/>
+ </manifest>
+-->
+ <fileset dir="${basedir}">
+ <include name="*"/>
+ <type type="file"/>
+ <exclude name="build.xml"/>
+ <exclude name="build.properties"/>
+ <exclude name=".*"/>
+ </fileset>
+ <fileset dir="${basedir}" includes="META-INF/**/*"/>
+ <fileset dir="${basedir}/packaging/" includes="**/*"/>
+ </ear>
+ <delete dir="packaging" includeemptydirs="true" quiet="true"/>
+ </sequential>
+ </target>
+
+ <property name="distDir" location="./dist/"/>
+
+ <target name="deploy" depends="all">
+ <copy todir="${jboss-deploy-dir}" verbose="true">
+ <fileset dir="${distDir}" includes="**/*"/>
+ </copy>
+ </target>
+
+ <target name="undeploy">
+ <pathconvert property="undeploy.files" pathsep=" ">
+ <mapper type="regexp" from="^${distDir}/(.*)$" to="${jboss-deploy-dir}/\1"/>
+ <fileset dir="${distDir}" includes="**/*"/>
+ </pathconvert>
+ <echo>Undeploy ${undeploy.files}</echo>
+ <delete includeemptydirs="true" verbose="true">
+ <filelist files="${undeploy.files}" />
+ </delete>
+ </target>
+
+
+ <target name="test" depends="build">
+ <echo>${jboss-endorsed-dir}</echo>
+ <java classname="${test-client}" fork="true">
+ <jvmarg value="-Djava.endorsed.dirs=${jboss-endorsed-dir}"/>
+ <jvmarg value="-Djava.security.policy=${auth-conf}"/>
+<!--
+ -Djava.security.manager -Djava.security.policy=$JBOSS_HOME/bin/java.policy"
+-->
+ <classpath>
+ <path refid="classpath"/>
+ </classpath>
+ </java>
+ </target>
+
+ <target name="junit" depends="build">
+ <!-- <echo>security-policy: ${security-policy}</echo> -->
+ <junit fork="false" showoutput="true" printsummary="true" filtertrace="false"
+ haltonfailure="false"
+ outputtoformatters="false">
+<!--
+ <jvmarg value="-Djava.rmi.server.logCalls=true"/>
+ <jvmarg value="-Djava.security.policy=${security-policy}"/>
+ <sysproperty key="java.security.policy" value="${security-policy}"/>
+
+ <jvmarg value="-Djava.security.auth.login.config=${auth-conf}"/>
+ <sysproperty key="java.security.auth.login.config" value="${auth-conf}"/>
+-->
+
+ <classpath refid="classpath"/>
+ <formatter type="plain" usefile="false"/>
+ <test name="${test-case}"/>
+ </junit>
+ </target>
+
+ <target name="export-zip" depends="clean">
+ <mkdir dir="${dist}"/>
+ <zip destfile="${dist}/${archive-name}-src.zip">
+ <fileset dir="../">
+ <include name="${archive.name}/**/*"/>
+ <exclude name="${dist}"/>
+ </fileset>
+ </zip>
+ </target>
+
+ <target name="export-testcase" depends="clean">
+ <echo>This target will split this deployment up into java files and resources which is useful when moving it to the JBoss testsuite</echo>
+ <input message="Enter java source directory:" addproperty="testcase.source.dir"/>
+ <input message="Enter resource directory:" addproperty="testcase.resource.dir"/>
+
+ <echo>Copying java source to ${testcase.source.dir}</echo>
+ <mkdir dir="${testcase.source.dir}"/>
+ <copy todir="${testcase.source.dir}">
+ <fileset dir=".">
+ <include name="**/*.java"/>
+ </fileset>
+ </copy>
+
+ <echo>Copying resources to ${testcase.resource.dir}</echo>
+ <mkdir dir="${testcase.resource.dir}"/>
+ <copy todir="${testcase.resource.dir}">
+ <fileset dir=".">
+ <exclude name="**/*.java"/>
+ <exclude name="**/build.xml"/>
+ <exclude name="**/build.properties"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="help">
+ <echo>archive-name = ${archive-name}</echo>
+ <echo>all - builds and packages the archive in the dist/ directory</echo>
+ <echo>build - builds the *.java files</echo>
+ <echo>clean - deletes the compiled classes *.java and the dist/ directory</echo>
+ <echo>deploy - deploys the archive in $JBOSS_HOME/server/$JBOSS_PROFILE - defaults to default, can be set in env variables or build.properties</echo>
+ <echo>export-zip - cleans then zips up the source in a zip file in dist/ directory</echo>
+ <echo>test - calls build, then runs a test client, the test client class is defined in build.properties property name: test-client</echo>
+ <echo>undeploy - undeploys the archive in $JBOSS_HOME/server/$JBOSS_SERVER - defaults to default, can be set in env variables or build.properties</echo>
+ </target>
+
+ <target name="mavenize-package" if="ear">
+ <sequential>
+ <!-- call it here, b/c ear does not have build called on it, putting it in package would be duplicated by the depends=build -->
+ <init/>
+ <!-- call herre, b/c depends would delete the dist files before checking ear-package.notrequired -->
+ <!-- <delete dir="dist" includeemptydirs="true" quiet="true" includes="**/*"/> -->
+
+ <!-- <copy flatten="true" todir="${dist}"> -->
+ <copy todir="${dist}">
+ <fileset dir="${basedir}/">
+ <include name="*/dist/**/*"/>
+ </fileset>
+ <regexpmapper from="^.*/dist/(.*)$$" to="\1"/>
+ </copy>
+
+<!--
+ <copy flatten="true" todir="packaging/lib/">
+ <fileset dir="${basedir}/lib">
+ <include name="*.jar/dist/*.jar"/>
+ <include name="*.jar"/>
+ <type type="file"/>
+ </fileset>
+ </copy>
+-->
+<!--
+ <ear destfile="dist/${archive.name}" appxml="META-INF/application.xml">
+ <fileset dir="${basedir}">
+ <include name="*"/>
+ <type type="file"/>
+ <exclude name="build.xml"/>
+ <exclude name="build.properties"/>
+ <exclude name=".*"/>
+ </fileset>
+ <fileset dir="${basedir}" includes="META-INF/**/*"/>
+ <fileset dir="${basedir}/packaging/" includes="**/*"/>
+ </ear>
+-->
+ </sequential>
+ </target>
+
+ <macrodef name="mavenize-ejb-template">
+ <attribute name="outputFile"/>
+
+ <attribute name="project-groupId"/>
+ <attribute name="project-artifactId"/>
+ <attribute name="project-version"/>
+ <attribute name="project-name"/>
+ <attribute name="project-description"/>
+
+ <attribute name="parent-groupId"/>
+ <attribute name="parent-artifactId"/>
+ <attribute name="parent-version"/>
+ <attribute name="parent-relativePath"/>
+
+ <attribute name="build-finalName"/>
+ <sequential>
+ <copy tofile="@{outputFile}/" file="ejb-pom.xml">
+ <filterset>
+ <filter token="project-groupId" value="@{project-groupId}"/>
+ <filter token="project-artifactId" value="@{project-artifactId}"/>
+ <filter token="project-version" value="@{project-version}"/>
+ <filter token="project-name" value="@{project-name}"/>
+ <filter token="project-description" value="@{project-description}"/>
+
+ <filter token="parent-groupId" value="@{parent-groupId}"/>
+ <filter token="parent-artifactId" value="@{parent-artifactId}"/>
+ <filter token="parent-version" value="@{parent-version}"/>
+ <filter token="parent-relativePath" value="@{parent-relativePath}"/>
+
+ <filter token="build-finalName" value="@{build-finalName}"/>
+ </filterset>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <target name="mavenize" depends="clean">
+ <mkdir dir="${dist}"/>
+
+ <iterate target="mavenize"/>
+
+ <!-- create a top level parent directory for the example that will have a pom.xml to call all the others ? -->
+
+ <!-- create directory without extension for each -->
+ <!-- using iterate, create them using archive-name in dist -->
+ <mkdir dir="${dist}/${archive-name}-${archive-type}"/>
+
+ <!-- note only jars that do not have a build.xml should be copied, everything else should be done via maven dependency -->
+ <!-- how to deal with jars in ear/lib, war/WEB-INF/lib ? Does maven structure have a lib directory to avoid pom.xml settings ? -->
+ <!-- war has my-webapp/src/main/webapp/WEB-INF , it looks like creating a lib dir and copying jars may work -->
+ <!-- ear has my-earapp/src/main/application/lib, it looks like creating a lib dir and copying jars may work -->
+
+ <echo>mavenize ${dist}/${archive-name}-${archive-type}/pom.xml</echo>
+ <mavenize-ejb-template outputFile="${dist}/${archive-name}-${archive-type}/pom.xml"
+ project-groupId="org.jboss.as.quickstarts" project-artifactId="${archive-name}-${archive-type}"
+ project-version="7.1.2.Final-redhat-1" project-name="${archive-name}-${archive-type}"
+ project-description="${archive-name}-${archive-type} description"
+ parent-groupId="org.jboss.as.quickstarts" parent-artifactId="${archive-name}"
+ parent-version="7.1.2.Final-redhat-1" parent-relativePath="../pom.xml"
+ build-finalName="${archive-name}-${archive-type}"/>
+
+ <!-- copy META-INF to resources -->
+ <mkdir dir="${dist}/${archive-name}-${archive-type}/src/main/resources/"/>
+ <copy todir="${dist}/${archive-name}-${archive-type}/src/main/resources/">
+ <fileset dir="${basedir}">
+ <include name="META-INF/**/*"/>
+ </fileset>
+ </copy>
+
+ <mkdir dir="${dist}/${archive-name}-${archive-type}/src/main/java/"/>
+ <copy todir="${dist}/${archive-name}-${archive-type}/src/main/java/">
+ <fileset dir="${basedir}">
+ <exclude name="dist/**/*"/>
+ <exclude name="dist/"/>
+ <exclude name="META-INF/"/>
+ <exclude name="META-INF/**/*"/>
+ <exclude name="build.xml"/>
+ <exclude name="build.properties"/>
+ <exclude name="*pom.xml"/>
+ <exclude name="*.sh"/>
+ </fileset>
+ </copy>
+
+<!--
+ It looks like each module just needs to specify parent, packaging type, and artifact, then have the ear declare dependencies on the sub modules
+ <parent>
+ <artifactId>ejb-remote-eap6</artifactId>
+ <groupId>ejb-remote-eap6</groupId>
+ <version>7.1.1.CR2</version>
+ </parent>
+
+ <artifactId>ejb-remote-eap6-ear</artifactId>
+ <packaging>ear</packaging>
+
+ <name>ejb-remote-eap6 EAR module</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>ejb-remote-eap6</groupId>
+ <artifactId>ejb-remote-eap6-web</artifactId>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>ejb-remote-eap6</groupId>
+ <artifactId>ejb-remote-eap6-ejb</artifactId>
+ <type>ejb</type>
+ </dependency>
+ </dependencies>
+-->
+
+
+ <!-- copy appropriate pom.xml, use the @ replace against a template -->
+ <touch file="${dist}/${archive-name}-${archive-type}/pom.xml"/>
+
+ <!-- create .project ? -->
+
+ <!-- This will only get called for an ear currently -->
+ <antcall target="mavenize-package"/>
+ </target>
+
+</project>
View
BIN  saajTest.ear/lib/saajOverride.jar
Binary file not shown
View
0  saajTest.ear/saajTest.jar/META-INF/MANIFEST.MF
No changes.
View
2  saajTest.ear/saajTest.jar/build.properties
@@ -0,0 +1,2 @@
+test-client=
+auth-conf=${basedir}/auth.conf
View
729 saajTest.ear/saajTest.jar/build.xml
@@ -0,0 +1,729 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ To the extent possible under law, Red Hat, Inc. has dedicated all copyright
+ to this software to the public domain worldwide, pursuant to the CC0 Public
+ Domain Dedication. This software is distributed without any warranty. See
+ <http://creativecommons.org/publicdomain/zero/1.0/>.
+-->
+<!--
+author: Brad Maxwell
+Simplified Build
+version 0.4 May 28, 2010
+Added Help
+Adding custom lib directory in build.properties
+-->
+
+<project name="simplified-build" default="all">
+ <!-- ===== PROPERTIES ===== -->
+ <property environment="env"/>
+ <!-- <basename property="dirName" file="${env.PWD}"/> -->
+ <!-- <dirname property="script-dir" file="${ant.file.main}"/> --> <!-- same as env.BUILD_SCRIPTS -->
+
+ <basename property="dirName" file="${basedir}"/>
+
+ <!-- <available property="unified-build-exists" file="${basedir}/unified-build.xml" value="true"/> -->
+ <property name="parentDir" location="${basedir}/.."/>
+
+ <property file="build.properties"/> <!-- Include build.properties -->
+
+ <!-- environment variables that need to be set -->
+ <condition property="jboss-home" value="${JBOSS_HOME}" else="${env.JBOSS_HOME}"><isset property="JBOSS_HOME"/></condition>
+
+ <!-- init method will verify they are set -->
+
+ <!-- AS7 / EAP6 -->
+ <available file="${jboss-home}/modules" property="AS7"/>
+
+ <!-- use default if env.JBOSS_PROFILE is not set and not specified in build.properties -->
+ <condition property="JBOSS_PROFILE" value="standalone" else="default"><isset property="AS7"/></condition>
+
+ <!-- <condition property="jboss-server" value="${JBOSS_PROFILE}" else="${env.JBOSS_PROFILE}"><isset property="JBOSS_PROFILE"/></condition> -->
+ <condition property="jboss-server" value="${env.JBOSS_PROFILE}" else="${JBOSS_PROFILE}"><isset property="env.JBOSS_PROFILE"/></condition>
+
+
+ <condition property="jboss-server-dir" value="${jboss-home}/${jboss-server}" else="${jboss-home}/server/${jboss-server}"><isset property="AS7"/></condition>
+
+ <condition property="jboss-deploy-dir" value="${jboss-server-dir}/deployments/" else="${jboss-server-dir}/deploy/"><isset property="AS7"/></condition>
+ <!-- <property name="jboss-endorsed-dir" location="${jboss-home}/lib/endorsed/"/> -->
+
+ <condition property="lib" value="${jboss-home}/modules/" else="${jboss-server-dir}/lib"><isset property="AS7"/></condition>
+ <property name="ant.project.name" value="${dirName}" />
+ <property name="archive.name" value="${dirName}" />
+ <property name="dist" value="dist"/>
+
+ <condition property="debuglevel" value="${debuglevel}" else="lines,vars,source"><isset property="debuglevel"/></condition>
+ <condition property="debug" value="${debug}" else="on"><isset property="debug"/></condition>
+
+ <!-- can set property, then use condition value="", if condition is not satisfied, it will not change the property -->
+
+ <!-- ===== ARCHIVE-TYPE ===== -->
+ <condition property="archive-type" value="jar"><matches string="${dirName}" pattern="^.*\.jar$"/></condition>
+ <condition property="archive-type" value="sar"><matches string="${dirName}" pattern="^.*\.sar$"/></condition>
+ <condition property="archive-type" value="war"><matches string="${dirName}" pattern="^.*\.war$"/></condition>
+ <condition property="archive-type" value="ear"><matches string="${dirName}" pattern="^.*\.ear$"/></condition>
+ <condition property="archive-type" value="aop"><matches string="${dirName}" pattern="^.*\.aop$"/></condition>
+ <condition property="archive-type" value="beans"><matches string="${dirName}" pattern="^.*\.beans$"/></condition>
+
+ <!-- this is the name of the ear/war/jar/... without the extension -->
+ <basename property="archive-name" file="${basedir}" suffix=".${archive-type}"/>
+
+ <!-- this property checks to see if it is an ear, and if so it will prevent the build target being called on the ear -->
+ <condition property="build" value="true">
+ <not><matches string="${archive-type}" pattern="ear"/></not>
+ </condition>
+
+ <!-- used to determine if ear needs to be packaged -->
+ <condition property="ear" value="true">
+ <matches string="${archive-type}" pattern="ear"/>
+ </condition>
+
+<!--
+ <condition property="manifest-class-path" value=""><not><isset property="manifest-class-path"/></not></condition>
+-->
+ <condition property="main-class" value=""><not><isset property="main-class"/></not></condition>
+
+ <condition property="earLib" value="${parentDir}/lib/" else="">
+ <and>
+ <matches string="${parentDir}" pattern="^.*\.ear$"/>
+ <available file="${parentDir}/lib" type="dir"/>
+ </and>
+ </condition>
+
+ <condition property="apiJarEarLib" value="../" else="">
+ <!-- for api-jar in lib dir -->
+ <and>
+ <!-- <matches string="${parentDir}" pattern="^.*/lib$"/> --> <!-- TODO this doesn't work on win -->
+ <matches string="${dirName}" pattern="^.*-api.jar$"/>
+ </and>
+ </condition>
+
+ <condition property="buildPath" value="WEB-INF/classes" else="">
+ <matches string="${archive-type}" pattern="^war$"/>
+ </condition>
+ <condition property="buildPath" value="" else=".">
+ <matches string="${archive-type}" pattern="^ear$"/>
+ </condition>
+
+ <!-- this should be . if in ear or .. if in sub dir -->
+ <condition property="ear-sub-archives-dir" value="." else="..">
+ <matches string="${archive-type}" pattern="^ear$"/>
+ </condition>
+ <condition property="ear-lib-dir" value="./lib" else="../lib">
+ <matches string="${archive-type}" pattern="^ear$"/>
+ </condition>
+
+ <condition property="include-build-classpath" value="">
+ <not><isset property="include-build-classpath"/></not>
+ </condition>
+
+ <!-- ===== PATHS / SETS ===== -->
+
+ <fileset dir="${basedir}" id="war.package.fileset">
+ <exclude name="**/*.java"/>
+ <exclude name="dist/"/>
+ <exclude name="build.xml"/>
+ <exclude name="build.properties"/>
+ <exclude name=".*"/>
+ </fileset>
+
+ <fileset dir="${basedir}" id="jar.package.fileset">
+ <exclude name="**/*.java"/>
+ <exclude name="bin/"/>
+ <exclude name="dist/"/>
+ <exclude name="build.xml"/>
+ <exclude name="build.properties"/>
+ </fileset>
+
+ <path id="classpath">
+ <!-- <path refid="user-classpath"/> -->
+ <pathelement location="${buildPath}" />
+
+ <fileset dir="${include-build-classpath}" includes="**/*.jar"/>
+
+ <dirset dir="${earLib}">
+ <include name="*-api.jar"/>
+ </dirset>
+
+ <!-- include jar,sar,war buildpaths in classpath -->
+ <dirset dir="${ear-sub-archives-dir}">
+ <include name="*.jar"/>
+ <include name="*.sar"/>
+ <include name="*.war/WEB-INF/classes"/>
+ </dirset>
+
+<!-- duplicate
+ <fileset dir="${ear-sub-archives-dir}">
+ <include name="*.jar"/>
+ </fileset>
+-->
+
+ <fileset dir="${jboss-home}/" includes="common/lib/**/*.jar"/> <!-- eap 5 -->
+ <fileset dir="${jboss-home}/" includes="lib/**/*.jar"/>
+ <fileset dir="${jboss-home}/" includes="client/**/*.jar"/>
+ <fileset dir="${jboss-home}/" includes="jboss-modules.jar"/> <!-- eap6 -->
+ <fileset dir="${jboss-server-dir}/" includes="lib/**/*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="**/jsf*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="**/portal-*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="**/portlet-*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="*jboss-portal*/**/*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="*ejb3.deployer*/**/*.jar"/>
+ <fileset dir="${jboss-server-dir}/" includes="deployers/**/*.jar"/>
+
+ <!-- if parent dir is an EAR and contains a lib dir then add to classpath -->
+ <fileset dir="${earLib}">
+ <type type="file"/>
+ <include name="**/*.jar"/>
+ </fileset>
+ <fileset dir="${apiJarEarLib}">
+ <include name="**/*.jar"/>
+ </fileset>
+
+ <!-- add support for lib declared in build.properties -->
+ <fileset dir="${lib}">
+ <include name="**/*.jar"/>
+ </fileset>
+
+ </path>
+
+ <!-- =============================== -->
+ <path id="ordered-dirs">
+ <fileset dir="${basedir}" includes="lib/*-api.jar/build.xml" id="lib-api-dirs"/>
+ <fileset dir="${basedir}" includes="lib/*.jar/build.xml" excludes="*-api.jar/build.xml" id="lib-api-dirs2"/>
+ <fileset dir="${basedir}" includes="*-api.jar/build.xml" id="api-dirs"/>
+ <fileset dir="${basedir}" includes="*.jar/build.xml" id="jar-dirs">
+ <and>
+ <filename name="*.jar/build.xml"/>
+ <filename name="*-api.jar/build.xml" negate="true"/>
+ <filename name="*-ejb.jar/build.xml" negate="true"/>
+ </and>
+ </fileset>
+ <fileset dir="${basedir}" includes="*.sar/build.xml" id="sar-dirs"/>
+ <fileset dir="${basedir}" includes="*-ejb.jar/build.xml" id="ejb-dirs"/>
+ <fileset dir="${basedir}" includes="*.aop/build.xml" id="aop-dirs"/>
+ <fileset dir="${basedir}" includes="*.war/build.xml" id="war-dirs"/>
+ </path>
+
+<!-- =============================== -->
+
+ <!-- ===== MACRODEFS ===== -->
+ <macrodef name="iterate">
+ <attribute name="target"/>
+ <sequential>
+ <subant target="@{target}" inheritall="false" inheritrefs="false" verbose="false">
+ <!-- <reference refid="user-classpath" torefid="user-classpath"/> -->
+ <property name="caller" location="."/>
+ <property name="main.build" location="${ant.file.main}"/>
+ <path refid="ordered-dirs"/>
+ </subant>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="check-env-set">
+ <attribute name="var"/>
+ <sequential>
+ <fail message="Please set the environment variable @{var}" unless="@{var}"/>
+ </sequential>
+ </macrodef>
+
+
+ <!-- ===== TARGETS ===== -->
+
+ <!-- [SB2] requires inits for everything -->
+ <!-- BEGIN OF INITS -->
+ <!-- this property will allow only *-init methods needed to be created, all other will direct to jar-init -->
+ <condition property="init-type" value="jar" else="${archive-type}"><not><matches string="${archive-type}" pattern="^[ew]ar$"/></not></condition>
+
+ <macrodef name="init">
+ <sequential>
+ <check-env-set var="env.JBOSS_HOME"/>
+ <check-env-set var="jboss-server"/>
+
+ <echo>Running ${archive-type} build scripts : ${ant.file}</echo>
+ <fail message="Unable to build ${dirName}. It should be a jar, war, ear, ..."
+ unless="archive-type"/>
+
+ <antcall target="${init-type}-init"/>
+ </sequential>
+ </macrodef>
+
+ <target name="ear-init">
+ <!-- [SB1] - create ear's META-INF & lib & touch application.xml if it does not exist -->
+ <!-- moved to ear-init instead of package, because war build requires war-init to be called before packaging & all builds use jar build now -->
+ <mkdir dir="${basedir}/META-INF/"/>
+ <mkdir dir="${basedir}/lib/"/>
+ <touch file="${basedir}/META-INF/application.xml"/>
+ </target>
+
+ <target name="jar-init">
+ <mkdir dir="${basedir}/META-INF/"/>
+ <touch file="${basedir}/META-INF/MANIFEST.MF"/>
+ </target>
+
+ <target name="war-init">
+ <!-- [SB2] - create WEB-INF/classes, WEB-INF/lib if it does not exist -->
+ <mkdir dir="${basedir}/META-INF/"/>
+ <mkdir dir="${basedir}/WEB-INF/classes/"/>
+ <mkdir dir="${basedir}/WEB-INF/lib/"/>
+ <touch file="${basedir}/META-INF/MANIFEST.MF"/>
+ </target>
+
+ <!-- END OF INITS -->
+
+ <target name="all">
+ <antcall target="build"/>
+ <antcall target="package"/>
+ </target>
+
+ <target name="clean">
+ <init/>
+
+ <delete dir="dist" includeemptydirs="true" quiet="true"/>
+
+ <delete verbose="true">
+ <fileset dir="." includes="**/*.class" />
+ </delete>
+
+ <!-- <antcall target="${archive-type}-clean"/> --> <!-- Removed individual cleans -->
+
+ <iterate target="clean"/>
+ </target>
+
+ <target name="build" if="build">
+ <build/>
+ <!-- <property name="build" value="false"/> -->
+ </target>
+
+ <macrodef name="build">
+ <sequential>
+ <init/>
+ <iterate target="build"/>
+
+<!-- <antcall target="${archive-type}-build"/> -->
+
+ <!-- everything except war and ear -->
+<!--
+ <property name="srcpath" value="${basedir}"/>
+ <property name="destdir" value="${basedir}"/>
+-->
+
+ <!-- if war -->
+<!--
+ <property name="srcpath" value="${basedir}/WEB-INF/classes"/>
+ <property name="destdir" value="${basedir}/WEB-INF/classes"/>
+-->
+
+ <condition property="srcpath" value="${basedir}/WEB-INF/classes" else="${basedir}"><matches string="${archive-type}" pattern="war"/></condition>
+ <condition property="destdir" value="${basedir}/WEB-INF/classes" else="${basedir}"><matches string="${archive-type}" pattern="war"/></condition>
+
+ <echo>PROPS: ${srcpath} ${destdir}</echo>
+
+ <javac destdir="${destdir}" debug="${debug}" debuglevel="${debuglevel}">
+ <src path="${srcpath}"/>
+ <classpath refid="classpath"/>
+ </javac>
+ </sequential>
+ </macrodef>
+
+ <target name="package" depends="build">
+ <mkdir dir="dist"/>
+ <iterate target="package"/>
+
+ <antcall target="${archive-type}-package"/>
+
+ </target>
+
+<!-- JAR Build -->
+
+<!--
+ <target name="jar-build">
+ <sequential>
+ <javac destdir="." debug="${debug}" debuglevel="${debuglevel}">
+ <src path="${basedir}"/>
+ <classpath refid="classpath"/>
+ </javac>
+ </sequential>
+ </target>
+-->
+ <target name="jar-package">
+ <jar-package/>
+ </target>
+
+ <target name="aop-package">
+ <jar-package/>
+ </target>
+
+ <target name="beans-package">
+ <jar-package/>
+ </target>
+
+ <target name="sar-package">
+ <jar-package/>
+ </target>
+
+ <macrodef name="jar-package">
+ <sequential>
+<!--
+ <manifest file="META-INF/MANIFEST.MF" mode="update">
+ <attribute name="Class-Path" value="${manifest-class-path}"/>
+ <attribute name="Main-Class" value="${main-class}"/>
+ </manifest>
+-->
+
+ <jar destfile="dist/${archive.name}" manifest="META-INF/MANIFEST.MF">
+ <fileset refid="jar.package.fileset"/>
+ </jar>
+ </sequential>
+ </macrodef>
+
+<!-- WAR -->
+<!--
+ <target name="war-all" depends="war-build, war-package"> </target>
+
+ <target name="war-clean"> </target>
+-->
+
+ <target name="war-build">
+
+ <javac destdir="WEB-INF/classes/" debug="${debug}" debuglevel="${debuglevel}">
+ <src path="WEB-INF/classes"/>
+ <classpath refid="classpath"/>
+ </javac>
+ </target>
+
+ <target name="war-package">
+ <mkdir dir="dist"/>
+
+<!--
+ <manifest file="META-INF/MANIFEST.MF" mode="update">
+ <attribute name="Class-Path" value="${manifest-class-path}"/>
+ </manifest>
+-->
+
+
+ <war destfile="dist/${archive.name}" needxmlfile="false" manifest="META-INF/MANIFEST.MF">
+ <fileset refid="war.package.fileset"/>
+ </war>
+ </target>
+
+<!-- SAR & rar same as jar-->
+
+<!-- EAR -->
+ <uptodate property="ear-package.notrequired" targetfile="dist/${archive.name}" >
+ <srcfiles dir= "${basedir}" includes="**/dist/*"/>
+ </uptodate>
+
+ <target name="ear-all" depends="">
+ <echo>Calling sub archives build</echo>
+ <!--<antcall target="ear-build"/>-->
+ <antcall target="ear-package"/>
+ </target>
+
+<!--
+ <target name="ear-build">
+ </target>
+-->
+
+ <target name="ear-package" if="ear">
+ <sequential>
+ <!-- call it here, b/c ear does not have build called on it, putting it in package would be duplicated by the depends=build -->
+ <init/>
+ <!-- call herre, b/c depends would delete the dist files before checking ear-package.notrequired -->
+ <delete dir="dist" includeemptydirs="true" quiet="true" includes="**/*"/>
+
+ <mkdir dir="packaging"/>
+ <mkdir dir="packaging/lib/"/>
+
+ <copy flatten="true" todir="packaging">
+ <fileset dir="${basedir}">
+ <include name="*/dist/*"/>
+ </fileset>
+ </copy>
+
+ <copy flatten="true" todir="packaging/lib/">
+ <fileset dir="${basedir}/lib">
+ <include name="*.jar/dist/*.jar"/> <!-- include dirs *.jar/dist/*.jar and any jar files in the lib -->
+ <include name="*.jar"/>
+ <type type="file"/>
+ </fileset>
+ </copy>
+
+ <ear destfile="dist/${archive.name}" appxml="META-INF/application.xml">
+<!--
+ <manifest>
+ <attribute name="Class-Path" value="${manifest-class-path}"/>
+ </manifest>
+-->
+ <fileset dir="${basedir}">
+ <include name="*"/>
+ <type type="file"/>
+ <exclude name="build.xml"/>
+ <exclude name="build.properties"/>
+ <exclude name=".*"/>
+ </fileset>
+ <fileset dir="${basedir}" includes="META-INF/**/*"/>
+ <fileset dir="${basedir}/packaging/" includes="**/*"/>
+ </ear>
+ <delete dir="packaging" includeemptydirs="true" quiet="true"/>
+ </sequential>
+ </target>
+
+ <property name="distDir" location="./dist/"/>
+
+ <target name="deploy" depends="all">
+ <copy todir="${jboss-deploy-dir}" verbose="true">
+ <fileset dir="${distDir}" includes="**/*"/>
+ </copy>
+ </target>
+
+ <target name="undeploy">
+ <pathconvert property="undeploy.files" pathsep=" ">
+ <mapper type="regexp" from="^${distDir}/(.*)$" to="${jboss-deploy-dir}/\1"/>
+ <fileset dir="${distDir}" includes="**/*"/>
+ </pathconvert>
+ <echo>Undeploy ${undeploy.files}</echo>
+ <delete includeemptydirs="true" verbose="true">
+ <filelist files="${undeploy.files}" />
+ </delete>
+ </target>
+
+
+ <target name="test" depends="build">
+ <echo>${jboss-endorsed-dir}</echo>
+ <java classname="${test-client}" fork="true">
+ <jvmarg value="-Djava.endorsed.dirs=${jboss-endorsed-dir}"/>
+ <jvmarg value="-Djava.security.policy=${auth-conf}"/>
+<!--
+ -Djava.security.manager -Djava.security.policy=$JBOSS_HOME/bin/java.policy"
+-->
+ <classpath>
+ <path refid="classpath"/>
+ </classpath>
+ </java>
+ </target>
+
+ <target name="junit" depends="build">
+ <!-- <echo>security-policy: ${security-policy}</echo> -->
+ <junit fork="false" showoutput="true" printsummary="true" filtertrace="false"
+ haltonfailure="false"
+ outputtoformatters="false">
+<!--
+ <jvmarg value="-Djava.rmi.server.logCalls=true"/>
+ <jvmarg value="-Djava.security.policy=${security-policy}"/>
+ <sysproperty key="java.security.policy" value="${security-policy}"/>
+
+ <jvmarg value="-Djava.security.auth.login.config=${auth-conf}"/>
+ <sysproperty key="java.security.auth.login.config" value="${auth-conf}"/>
+-->
+
+ <classpath refid="classpath"/>
+ <formatter type="plain" usefile="false"/>
+ <test name="${test-case}"/>
+ </junit>
+ </target>
+
+ <target name="export-zip" depends="clean">
+ <mkdir dir="${dist}"/>
+ <zip destfile="${dist}/${archive-name}-src.zip">
+ <fileset dir="../">
+ <include name="${archive.name}/**/*"/>
+ <exclude name="${dist}"/>
+ </fileset>
+ </zip>
+ </target>
+
+ <target name="export-testcase" depends="clean">
+ <echo>This target will split this deployment up into java files and resources which is useful when moving it to the JBoss testsuite</echo>
+ <input message="Enter java source directory:" addproperty="testcase.source.dir"/>
+ <input message="Enter resource directory:" addproperty="testcase.resource.dir"/>
+
+ <echo>Copying java source to ${testcase.source.dir}</echo>
+ <mkdir dir="${testcase.source.dir}"/>
+ <copy todir="${testcase.source.dir}">
+ <fileset dir=".">
+ <include name="**/*.java"/>
+ </fileset>
+ </copy>
+
+ <echo>Copying resources to ${testcase.resource.dir}</echo>
+ <mkdir dir="${testcase.resource.dir}"/>
+ <copy todir="${testcase.resource.dir}">
+ <fileset dir=".">
+ <exclude name="**/*.java"/>
+ <exclude name="**/build.xml"/>
+ <exclude name="**/build.properties"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="help">
+ <echo>archive-name = ${archive-name}</echo>
+ <echo>all - builds and packages the archive in the dist/ directory</echo>
+ <echo>build - builds the *.java files</echo>
+ <echo>clean - deletes the compiled classes *.java and the dist/ directory</echo>
+ <echo>deploy - deploys the archive in $JBOSS_HOME/server/$JBOSS_PROFILE - defaults to default, can be set in env variables or build.properties</echo>
+ <echo>export-zip - cleans then zips up the source in a zip file in dist/ directory</echo>
+ <echo>test - calls build, then runs a test client, the test client class is defined in build.properties property name: test-client</echo>
+ <echo>undeploy - undeploys the archive in $JBOSS_HOME/server/$JBOSS_SERVER - defaults to default, can be set in env variables or build.properties</echo>
+ </target>
+
+ <target name="mavenize-package" if="ear">
+ <sequential>
+ <!-- call it here, b/c ear does not have build called on it, putting it in package would be duplicated by the depends=build -->
+ <init/>
+ <!-- call herre, b/c depends would delete the dist files before checking ear-package.notrequired -->
+ <!-- <delete dir="dist" includeemptydirs="true" quiet="true" includes="**/*"/> -->
+
+ <!-- <copy flatten="true" todir="${dist}"> -->
+ <copy todir="${dist}">
+ <fileset dir="${basedir}/">
+ <include name="*/dist/**/*"/>
+ </fileset>
+ <regexpmapper from="^.*/dist/(.*)$$" to="\1"/>
+ </copy>
+
+<!--
+ <copy flatten="true" todir="packaging/lib/">
+ <fileset dir="${basedir}/lib">
+ <include name="*.jar/dist/*.jar"/>
+ <include name="*.jar"/>
+ <type type="file"/>
+ </fileset>
+ </copy>
+-->
+<!--
+ <ear destfile="dist/${archive.name}" appxml="META-INF/application.xml">
+ <fileset dir="${basedir}">
+ <include name="*"/>
+ <type type="file"/>
+ <exclude name="build.xml"/>
+ <exclude name="build.properties"/>
+ <exclude name=".*"/>
+ </fileset>
+ <fileset dir="${basedir}" includes="META-INF/**/*"/>
+ <fileset dir="${basedir}/packaging/" includes="**/*"/>
+ </ear>
+-->
+ </sequential>
+ </target>
+
+ <macrodef name="mavenize-ejb-template">
+ <attribute name="outputFile"/>
+
+ <attribute name="project-groupId"/>
+ <attribute name="project-artifactId"/>
+ <attribute name="project-version"/>
+ <attribute name="project-name"/>
+ <attribute name="project-description"/>
+
+ <attribute name="parent-groupId"/>
+ <attribute name="parent-artifactId"/>
+ <attribute name="parent-version"/>
+ <attribute name="parent-relativePath"/>
+
+ <attribute name="build-finalName"/>
+ <sequential>
+ <copy tofile="@{outputFile}/" file="ejb-pom.xml">
+ <filterset>
+ <filter token="project-groupId" value="@{project-groupId}"/>
+ <filter token="project-artifactId" value="@{project-artifactId}"/>
+ <filter token="project-version" value="@{project-version}"/>
+ <filter token="project-name" value="@{project-name}"/>
+ <filter token="project-description" value="@{project-description}"/>
+
+ <filter token="parent-groupId" value="@{parent-groupId}"/>
+ <filter token="parent-artifactId" value="@{parent-artifactId}"/>
+ <filter token="parent-version" value="@{parent-version}"/>
+ <filter token="parent-relativePath" value="@{parent-relativePath}"/>
+
+ <filter token="build-finalName" value="@{build-finalName}"/>
+ </filterset>
+ </copy>
+ </sequential>
+ </macrodef>
+
+ <target name="mavenize" depends="clean">
+ <mkdir dir="${dist}"/>
+
+ <iterate target="mavenize"/>
+
+ <!-- create a top level parent directory for the example that will have a pom.xml to call all the others ? -->
+
+ <!-- create directory without extension for each -->
+ <!-- using iterate, create them using archive-name in dist -->
+ <mkdir dir="${dist}/${archive-name}-${archive-type}"/>
+
+ <!-- note only jars that do not have a build.xml should be copied, everything else should be done via maven dependency -->
+ <!-- how to deal with jars in ear/lib, war/WEB-INF/lib ? Does maven structure have a lib directory to avoid pom.xml settings ? -->
+ <!-- war has my-webapp/src/main/webapp/WEB-INF , it looks like creating a lib dir and copying jars may work -->
+ <!-- ear has my-earapp/src/main/application/lib, it looks like creating a lib dir and copying jars may work -->
+
+ <echo>mavenize ${dist}/${archive-name}-${archive-type}/pom.xml</echo>
+ <mavenize-ejb-template outputFile="${dist}/${archive-name}-${archive-type}/pom.xml"
+ project-groupId="org.jboss.as.quickstarts" project-artifactId="${archive-name}-${archive-type}"
+ project-version="7.1.2.Final-redhat-1" project-name="${archive-name}-${archive-type}"
+ project-description="${archive-name}-${archive-type} description"
+ parent-groupId="org.jboss.as.quickstarts" parent-artifactId="${archive-name}"
+ parent-version="7.1.2.Final-redhat-1" parent-relativePath="../pom.xml"
+ build-finalName="${archive-name}-${archive-type}"/>
+
+ <!-- copy META-INF to resources -->
+ <mkdir dir="${dist}/${archive-name}-${archive-type}/src/main/resources/"/>
+ <copy todir="${dist}/${archive-name}-${archive-type}/src/main/resources/">
+ <fileset dir="${basedir}">
+ <include name="META-INF/**/*"/>
+ </fileset>
+ </copy>
+
+ <mkdir dir="${dist}/${archive-name}-${archive-type}/src/main/java/"/>
+ <copy todir="${dist}/${archive-name}-${archive-type}/src/main/java/">
+ <fileset dir="${basedir}">
+ <exclude name="dist/**/*"/>
+ <exclude name="dist/"/>
+ <exclude name="META-INF/"/>
+ <exclude name="META-INF/**/*"/>
+ <exclude name="build.xml"/>
+ <exclude name="build.properties"/>
+ <exclude name="*pom.xml"/>
+ <exclude name="*.sh"/>
+ </fileset>
+ </copy>
+
+<!--
+ It looks like each module just needs to specify parent, packaging type, and artifact, then have the ear declare dependencies on the sub modules
+ <parent>
+ <artifactId>ejb-remote-eap6</artifactId>
+ <groupId>ejb-remote-eap6</groupId>
+ <version>7.1.1.CR2</version>
+ </parent>
+
+ <artifactId>ejb-remote-eap6-ear</artifactId>
+ <packaging>ear</packaging>
+
+ <name>ejb-remote-eap6 EAR module</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>ejb-remote-eap6</groupId>
+ <artifactId>ejb-remote-eap6-web</artifactId>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>ejb-remote-eap6</groupId>
+ <artifactId>ejb-remote-eap6-ejb</artifactId>
+ <type>ejb</type>
+ </dependency>
+ </dependencies>
+-->
+
+
+ <!-- copy appropriate pom.xml, use the @ replace against a template -->
+ <touch file="${dist}/${archive-name}-${archive-type}/pom.xml"/>
+
+ <!-- create .project ? -->
+
+ <!-- This will only get called for an ear currently -->
+ <antcall target="mavenize-package"/>
+ </target>
+
+</project>
View
31 saajTest.ear/saajTest.jar/com/redhat/gss/saaj/EjbSaajTest.java
@@ -0,0 +1,31 @@
+/*
+ * To the extent possible under law, Red Hat, Inc. has dedicated all copyright
+ * to this software to the public domain worldwide, pursuant to the CC0 Public
+ * Domain Dedication. This software is distributed without any warranty. See
+ * <http://creativecommons.org/publicdomain/zero/1.0/>.
+ */
+package com.redhat.gss.saaj;
+
+import javax.xml.soap.MessageFactory;
+import org.jboss.modules.ModuleClassLoader;
+import org.jboss.modules.Module;
+import org.jboss.logging.Logger;
+
+@javax.ejb.Singleton
+@javax.ejb.Startup
+public class EjbSaajTest
+{
+ private Logger log = Logger.getLogger(this.getClass().getName());
+
+ @javax.annotation.PostConstruct
+ public void test() throws Exception
+ {
+ Thread.sleep(2000);
+
+ MessageFactory mf = MessageFactory.newInstance();
+ log.info(mf.getClass().getName());
+
+ ModuleClassLoader cl = (ModuleClassLoader)Thread.currentThread().getContextClassLoader();
+ Module module = cl.getModule();
+ }
+}
View
0  saajTest.ear/saajTest.war/META-INF/MANIFEST.MF
No changes.
View
26 saajTest.ear/saajTest.war/WEB-INF/classes/com/redhat/gss/saaj/SaajTest.java
@@ -0,0 +1,26 @@
+/*
+ * To the extent possible under law, Red Hat, Inc. has dedicated all copyright
+ * to this software to the public domain worldwide, pursuant to the CC0 Public
+ * Domain Dedication. This software is distributed without any warranty. See
+ * <http://creativecommons.org/publicdomain/zero/1.0/>.
+ */
+package com.redhat.gss.saaj;
+
+import javax.xml.soap.MessageFactory;
+import org.jboss.modules.ModuleClassLoader;
+import org.jboss.modules.Module;
+
+@javax.jws.WebService
+public class SaajTest
+{
+ public String test() throws Exception
+ {
+ MessageFactory mf = MessageFactory.newInstance();
+ ModuleClassLoader cl = (ModuleClassLoader)Thread.currentThread().getContextClassLoader();
+ Module module = cl.getModule();
+ return module.toString();
+ /*
+ return ((ModuleClassLoader)mf.getClass().getClassLoader()).getModule().getIdentifier().toString();
+ */
+ }
+}
View
2  saajTest.ear/saajTest.war/build.properties
@@ -0,0 +1,2 @@
+test-client=
+auth-conf=${basedir}/auth.conf
View
729 saajTest.ear/saajTest.war/build.xml
@@ -0,0 +1,729 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ To the extent possible under law, Red Hat, Inc. has dedicated all copyright
+ to this software to the public domain worldwide, pursuant to the CC0 Public
+ Domain Dedication. This software is distributed without any warranty. See
+ <http://creativecommons.org/publicdomain/zero/1.0/>.
+-->
+<!--
+author: Brad Maxwell
+Simplified Build
+version 0.4 May 28, 2010
+Added Help
+Adding custom lib directory in build.properties
+-->
+
+<project name="simplified-build" default="all">
+ <!-- ===== PROPERTIES ===== -->
+ <property environment="env"/>
+ <!-- <basename property="dirName" file="${env.PWD}"/> -->
+ <!-- <dirname property="script-dir" file="${ant.file.main}"/> --> <!-- same as env.BUILD_SCRIPTS -->
+
+ <basename property="dirName" file="${basedir}"/>
+
+ <!-- <available property="unified-build-exists" file="${basedir}/unified-build.xml" value="true"/> -->
+ <property name="parentDir" location="${basedir}/.."/>
+
+ <property file="build.properties"/> <!-- Include build.properties -->
+
+ <!-- environment variables that need to be set -->
+ <condition property="jboss-home" value="${JBOSS_HOME}" else="${env.JBOSS_HOME}"><isset property="JBOSS_HOME"/></condition>
+
+ <!-- init method will verify they are set -->
+
+ <!-- AS7 / EAP6 -->
+ <available file="${jboss-home}/modules" property="AS7"/>
+
+ <!-- use default if env.JBOSS_PROFILE is not set and not specified in build.properties -->
+ <condition property="JBOSS_PROFILE" value="standalone" else="default"><isset property="AS7"/></condition>
+
+ <!-- <condition property="jboss-server" value="${JBOSS_PROFILE}" else="${env.JBOSS_PROFILE}"><isset property="JBOSS_PROFILE"/></condition> -->
+ <condition property="jboss-server" value="${env.JBOSS_PROFILE}" else="${JBOSS_PROFILE}"><isset property="env.JBOSS_PROFILE"/></condition>
+
+
+ <condition property="jboss-server-dir" value="${jboss-home}/${jboss-server}" else="${jboss-home}/server/${jboss-server}"><isset property="AS7"/></condition>
+
+ <condition property="jboss-deploy-dir" value="${jboss-server-dir}/deployments/" else="${jboss-server-dir}/deploy/"><isset property="AS7"/></condition>
+ <!-- <property name="jboss-endorsed-dir" location="${jboss-home}/lib/endorsed/"/> -->
+
+ <condition property="lib" value="${jboss-home}/modules/" else="${jboss-server-dir}/lib"><isset property="AS7"/></condition>
+ <property name="ant.project.name" value="${dirName}" />
+ <property name="archive.name" value="${dirName}" />
+ <property name="dist" value="dist"/>
+
+ <condition property="debuglevel" value="${debuglevel}" else="lines,vars,source"><isset property="debuglevel"/></condition>
+ <condition property="debug" value="${debug}" else="on"><isset property="debug"/></condition>
+
+ <!-- can set property, then use condition value="", if condition is not satisfied, it will not change the property -->
+
+ <!-- ===== ARCHIVE-TYPE ===== -->
+ <condition property="archive-type" value="jar"><matches string="${dirName}" pattern="^.*\.jar$"/></condition>
+ <condition property="archive-type" value="sar"><matches string="${dirName}" pattern="^.*\.sar$"/></condition>
+ <condition property="archive-type" value="war"><matches string="${dirName}" pattern="^.*\.war$"/></condition>
+ <condition property="archive-type" value="ear"><matches string="${dirName}" pattern="^.*\.ear$"/></condition>
+ <condition property="archive-type" value="aop"><matches string="${dirName}" pattern="^.*\.aop$"/></condition>
+ <condition property="archive-type" value="beans"><matches string="${dirName}" pattern="^.*\.beans$"/></condition>
+
+ <!-- this is the name of the ear/war/jar/... without the extension -->
+ <basename property="archive-name" file="${basedir}" suffix=".${archive-type}"/>
+
+ <!-- this property checks to see if it is an ear, and if so it will prevent the build target being called on the ear -->
+ <condition property="build" value="true">
+ <not><matches string="${archive-type}" pattern="ear"/></not>
+ </condition>
+
+ <!-- used to determine if ear needs to be packaged -->
+ <condition property="ear" value="true">
+ <matches string="${archive-type}" pattern="ear"/>
+ </condition>
+
+<!--
+ <condition property="manifest-class-path" value=""><not><isset property="manifest-class-path"/></not></condition>
+-->
+ <condition property="main-class" value=""><not><isset property="main-class"/></not></condition>
+
+ <condition property="earLib" value="${parentDir}/lib/" else="">
+ <and>
+ <matches string="${parentDir}" pattern="^.*\.ear$"/>
+ <available file="${parentDir}/lib" type="dir"/>
+ </and>
+ </condition>
+
+ <condition property="apiJarEarLib" value="../" else="">
+ <!-- for api-jar in lib dir -->
+ <and>
+ <!-- <matches string="${parentDir}" pattern="^.*/lib$"/> --> <!-- TODO this doesn't work on win -->
+ <matches string="${dirName}" pattern="^.*-api.jar$"/>
+ </and>
+ </condition>
+
+ <condition property="buildPath" value="WEB-INF/classes" else="">
+ <matches string="${archive-type}" pattern="^war$"/>
+ </condition>
+ <condition property="buildPath" value="" else=".">
+ <matches string="${archive-type}" pattern="^ear$"/>
+ </condition>
+
+ <!-- this should be . if in ear or .. if in sub dir -->
+ <condition property="ear-sub-archives-dir" value="." else="..">
+ <matches string="${archive-type}" pattern="^ear$"/>
+ </condition>
+ <condition property="ear-lib-dir" value="./lib" else="../lib">
+ <matches string="${archive-type}" pattern="^ear$"/>
+ </condition>
+
+ <condition property="include-build-classpath" value="">
+ <not><isset property="include-build-classpath"/></not>
+ </condition>
+
+ <!-- ===== PATHS / SETS ===== -->
+
+ <fileset dir="${basedir}" id="war.package.fileset">
+ <exclude name="**/*.java"/>
+ <exclude name="dist/"/>
+ <exclude name="build.xml"/>
+ <exclude name="build.properties"/>
+ <exclude name=".*"/>
+ </fileset>
+
+ <fileset dir="${basedir}" id="jar.package.fileset">
+ <exclude name="**/*.java"/>
+ <exclude name="bin/"/>
+ <exclude name="dist/"/>
+ <exclude name="build.xml"/>
+ <exclude name="build.properties"/>
+ </fileset>
+
+ <path id="classpath">
+ <!-- <path refid="user-classpath"/> -->
+ <pathelement location="${buildPath}" />
+
+ <fileset dir="${include-build-classpath}" includes="**/*.jar"/>
+
+ <dirset dir="${earLib}">
+ <include name="*-api.jar"/>
+ </dirset>
+
+ <!-- include jar,sar,war buildpaths in classpath -->
+ <dirset dir="${ear-sub-archives-dir}">
+ <include name="*.jar"/>
+ <include name="*.sar"/>
+ <include name="*.war/WEB-INF/classes"/>
+ </dirset>
+
+<!-- duplicate
+ <fileset dir="${ear-sub-archives-dir}">
+ <include name="*.jar"/>
+ </fileset>
+-->
+
+ <fileset dir="${jboss-home}/" includes="common/lib/**/*.jar"/> <!-- eap 5 -->
+ <fileset dir="${jboss-home}/" includes="lib/**/*.jar"/>
+ <fileset dir="${jboss-home}/" includes="client/**/*.jar"/>
+ <fileset dir="${jboss-home}/" includes="jboss-modules.jar"/> <!-- eap6 -->
+ <fileset dir="${jboss-server-dir}/" includes="lib/**/*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="**/jsf*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="**/portal-*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="**/portlet-*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="*jboss-portal*/**/*.jar"/>
+ <fileset dir="${jboss-deploy-dir}/" includes="*ejb3.deployer*/**/*.jar"/>
+ <fileset dir="${jboss-server-dir}/" includes="deployers/**/*.jar"/>
+
+ <!-- if parent dir is an EAR and contains a lib dir then add to classpath -->
+ <fileset dir="${earLib}">
+ <type type="file"/>
+ <include name="**/*.jar"/>
+ </fileset>
+ <fileset dir="${apiJarEarLib}">
+ <include name="**/*.jar"/>
+ </fileset>
+
+ <!-- add support for lib declared in build.properties -->
+ <fileset dir="${lib}">
+ <include name="**/*.jar"/>
+ </fileset>
+
+ </path>
+
+ <!-- =============================== -->
+ <path id="ordered-dirs">
+ <fileset dir="${basedir}" includes="lib/*-api.jar/build.xml" id="lib-api-dirs"/>
+ <fileset dir="${basedir}" includes="lib/*.jar/build.xml" excludes="*-api.jar/build.xml" id="lib-api-dirs2"/>
+ <fileset dir="${basedir}" includes="*-api.jar/build.xml" id="api-dirs"/>
+ <fileset dir="${basedir}" includes="*.jar/build.xml" id="jar-dirs">
+ <and>
+ <filename name="*.jar/build.xml"/>
+ <filename name="*-api.jar/build.xml" negate="true"/>
+ <filename name="*-ejb.jar/build.xml" negate="true"/>
+ </and>
+ </fileset>
+ <fileset dir="${basedir}" includes="*.sar/build.xml" id="sar-dirs"/>
+ <fileset dir="${basedir}" includes="*-ejb.jar/build.xml" id="ejb-dirs"/>
+ <fileset dir="${basedir}" includes="*.aop/build.xml" id="aop-dirs"/>
+ <fileset dir="${basedir}" includes="*.war/build.xml" id="war-dirs"/>
+ </path>
+
+<!-- =============================== -->
+
+ <!-- ===== MACRODEFS ===== -->
+ <macrodef name="iterate">
+ <attribute name="target"/>
+ <sequential>
+ <subant target="@{target}" inheritall="false" inheritrefs="false" verbose="false">
+ <!-- <reference refid="user-classpath" torefid="user-classpath"/> -->
+ <property name="caller" location="."/>
+ <property name="main.build" location="${ant.file.main}"/>
+ <path refid="ordered-dirs"/>
+ </subant>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="check-env-set">
+ <attribute name="var"/>
+ <sequential>
+ <fail message="Please set the environment variable @{var}" unless="@{var}"/>
+ </sequential>
+ </macrodef>
+
+
+ <!-- ===== TARGETS ===== -->
+
+ <!-- [SB2] requires inits for everything -->
+ <!-- BEGIN OF INITS -->
+ <!-- this property will allow only *-init methods needed to be created, all other will direct to jar-init -->
+ <condition property="init-type" value="jar" else="${archive-type}"><not><matches string="${archive-type}" pattern="^[ew]ar$"/></not></condition>
+
+ <macrodef name="init">
+ <sequential>
+ <check-env-set var="env.JBOSS_HOME"/>
+ <check-env-set var="jboss-server"/>
+
+ <echo>Running ${archive-type} build scripts : ${ant.file}</echo>
+ <fail message="Unable to build ${dirName}. It should be a jar, war, ear, ..."
+ unless="archive-type"/>
+
+ <antcall target="${init-type}-init"/>
+ </sequential>
+ </macrodef>
+
+ <target name="ear-init">
+ <!-- [SB1] - create ear's META-INF & lib & touch application.xml if it does not exist -->
+ <!-- moved to ear-init instead of package, because war build requires war-init to be called before packaging & all builds use jar build now -->
+ <mkdir dir="${basedir}/META-INF/"/>
+ <mkdir dir="${basedir}/lib/"/>
+ <touch file="${basedir}/META-INF/application.xml"/>
+ </target>
+
+ <target name="jar-init">
+ <mkdir dir="${basedir}/META-INF/"/>
+ <touch file="${basedir}/META-INF/MANIFEST.MF"/>
+ </target>
+
+ <target name="war-init">
+ <!-- [SB2] - create WEB-INF/classes, WEB-INF/lib if it does not exist -->
+ <mkdir dir="${basedir}/META-INF/"/>
+ <mkdir dir="${basedir}/WEB-INF/classes/"/>
+ <mkdir dir="${basedir}/WEB-INF/lib/"/>
+ <touch file="${basedir}/META-INF/MANIFEST.MF"/>
+ </target>
+
+ <!-- END OF INITS -->
+
+ <target name="all">
+ <antcall target="build"/>
+ <antcall target="package"/>
+ </target>
+
+ <target name="clean">
+ <init/>
+
+ <delete dir="dist" includeemptydirs="true" quiet="true"/>
+
+ <delete verbose="true">
+ <fileset dir="." includes="**/*.class" />
+ </delete>
+
+ <!-- <antcall target="${archive-type}-clean"/> --> <!-- Removed individual cleans -->
+
+ <iterate target="clean"/>
+ </target>
+
+ <target name="build" if="build">
+ <build/>
+ <!-- <property name="build" value="false"/> -->
+ </target>
+
+ <macrodef name="build">
+ <sequential>
+ <init/>
+ <iterate target="build"/>
+
+<!-- <antcall target="${archive-type}-build"/> -->
+
+ <!-- everything except war and ear -->
+<!--
+ <property name="srcpath" value="${basedir}"/>
+ <property name="destdir" value="${basedir}"/>
+-->
+
+ <!-- if war -->
+<!--
+ <property name="srcpath" value="${basedir}/WEB-INF/classes"/>
+ <property name="destdir" value="${basedir}/WEB-INF/classes"/>
+-->
+
+ <condition property="srcpath" value="${basedir}/WEB-INF/classes" else="${basedir}"><matches string="${archive-type}" pattern="war"/></condition>
+ <condition property="destdir" value="${basedir}/WEB-INF/classes" else="${basedir}"><matches string="${archive-type}" pattern="war"/></condition>
+
+ <echo>PROPS: ${srcpath} ${destdir}</echo>
+
+ <javac destdir="${destdir}" debug="${debug}" debuglevel="${debuglevel}">
+ <src path="${srcpath}"/>
+ <classpath refid="classpath"/>
+ </javac>
+ </sequential>
+ </macrodef>
+
+ <target name="package" depends="build">
+ <mkdir dir="dist"/>
+ <iterate target="package"/>
+
+ <antcall target="${archive-type}-package"/>
+
+ </target>
+
+<!-- JAR Build -->
+
+<!--
+ <target name="jar-build">
+ <sequential>
+ <javac destdir="." debug="${debug}" debuglevel="${debuglevel}">
+ <src path="${basedir}"/>
+ <classpath refid="classpath"/>
+ </javac>
+ </sequential>
+ </target>
+-->
+ <target name="jar-package">
+ <jar-package/>
+ </target>
+
+ <target name="aop-package">
+ <jar-package/>
+ </target>
+
+ <target name="beans-package">
+ <jar-package/>
+ </target>
+
+ <target name="sar-package">
+ <jar-package/>
+ </target>
+
+ <macrodef name="jar-package">
+ <sequential>
+<!--
+ <manifest file="META-INF/MANIFEST.MF" mode="update">
+ <attribute name="Class-Path" value="${manifest-class-path}"/>
+ <attribute name="Main-Class" value="${main-class}"/>
+ </manifest>
+-->
+
+ <jar destfile="dist/${archive.name}" manifest="META-INF/MANIFEST.MF">
+ <fileset refid="jar.package.fileset"/>
+ </jar>
+ </sequential>
+ </macrodef>
+
+<!-- WAR -->
+<!--
+ <target name="war-all" depends="war-build, war-package"> </target>
+
+ <target name="war-clean"> </target>
+-->
+
+ <target name="war-build">
+
+ <javac destdir="WEB-INF/classes/" debug="${debug}" debuglevel="${debuglevel}">
+ <src path="WEB-INF/classes"/>
+ <classpath refid="classpath"/>
+ </javac>
+ </target>
+
+ <target name="war-package">
+ <mkdir dir="dist"/>
+
+<!--
+ <manifest file="META-INF/MANIFEST.MF" mode="update">
+ <attribute name="Class-Path" value="${manifest-class-path}"/>
+ </manifest>
+-->
+
+
+ <war destfile="dist/${archive.name}" needxmlfile="false" manifest="META-INF/MANIFEST.MF">
+ <fileset refid="war.package.fileset"/>