blob: e56a96f2a179317102539adfcee3766b495a528b [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Revision: 1.21 $ $Date: 2004-10-27 20:54:09 +0600 (Wed, 27 Oct 2004) $ -->
<project default="jar"
xmlns:j="jelly:core"
xmlns:u="jelly:util"
xmlns:maven="jelly:maven"
xmlns:deploy="deploy"
xmlns:ant="jelly:ant">
<preGoal name="itest:compile">
<u:file var="file" name="${maven.itest.src}"/>
<j:if test="${!file.exists()}">
<j:expr value="${context.setVariable('maven.itest.skip', 'true')}"/>
</j:if>
</preGoal>
<postGoal name="test:compile">
<!-- Temp dir to hold the contents of the mar -->
<mkdir dir="target/temp-mar/META-INF"/>
<mkdir dir="target/temp-mar/lib"/>
<mkdir dir="target/modules"/>
<!-- Copy the required content for the mar into the temp dir-->
<copy todir="target/temp-mar">
<fileset dir="target/classes">
<include name="**/org/apache/*/**/*.class"/>
<exclude name="**/org/apache/axis2/security/InteropScenarioClient.class"/>
</fileset>
</copy>
<!--include the license for jars-->
<ant:copy toDir="target/temp-mar/lib">
<ant:fileset dir="../../legal/rampart">
<ant:include name="*.txt"/>
</ant:fileset>
</ant:copy>
<copy file="../../LICENSE.txt"
tofile="target/temp-mar/META-INF/LICENSE.txt" overwrite="true"/>
<j:if test="${context.getVariable('maven.jar.override').toString().trim().equalsIgnoreCase('on')}">
<copy file="${dependencies.dir}/xmlsec-${xmlsec.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${dependencies.dir}/bcprov-${bcprov.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${dependencies.dir}/opensaml-${opensaml.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${dependencies.dir}/wss4j-${wss4j.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${dependencies.dir}/jaxen-${jaxen.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${dependencies.dir}/xml-apis-${xml_apis.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${dependencies.dir}/xercesImpl-${xerces.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${dependencies.dir}/commons-codec-${commons.codec.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${dependencies.dir}/axis2-rahas-${pom.currentVersion}.jar" todir="target/temp-mar/lib"/>
<copy file="${dependencies.dir}/axis2-secpolicy-${pom.currentVersion}.jar" todir="target/temp-mar/lib"/>
</j:if>
<j:if test="${context.getVariable('maven.jar.override').toString().trim().equalsIgnoreCase('off')}">
<copy file="${maven.repo.local}/xml-security/jars/xmlsec-${xmlsec.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${maven.repo.local}/bouncycastle/jars/bcprov-${bcprov.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${maven.repo.local}/opensaml/jars/opensaml-${opensaml.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${maven.repo.local}/wss4j/jars/wss4j-${wss4j.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${maven.repo.local}/jaxen/jars/jaxen-${jaxen.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${maven.repo.local}/xml-apis/jars/xml-apis-${xml_apis.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${maven.repo.local}/xerces/jars/xercesImpl-${xerces.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${maven.repo.local}/commons-codec/jars/commons-codec-${commons.codec.version}.jar" todir="target/temp-mar/lib"/>
<copy file="${maven.repo.local}/org.apache.axis2/jars/axis2-rahas-${pom.currentVersion}.jar" todir="target/temp-mar/lib"/>
<copy file="${maven.repo.local}/org.apache.axis2/jars/axis2-secpolicy-${pom.currentVersion}.jar" todir="target/temp-mar/lib"/>
</j:if>
<copy file="src/META-INF/module.xml"
tofile="target/temp-mar/META-INF/module.xml" overwrite="true"/>
<copy file="src/META-INF/services/org.apache.neethi.builders.AssertionBuilder"
tofile="target/temp-mar/META-INF/services/org.apache.neethi.builders.AssertionBuilder" overwrite="true" />
<jar jarfile="target/rampart-${rampart_module_version}.mar" basedir="target/temp-mar/">
<include name="**/*"/>
</jar>
<copy file="target/rampart-${rampart_module_version}.mar" tofile="target/modules/rampart-${rampart_module_version}.mar"/>
<copy file="target/rampart-${rampart_module_version}.mar" tofile="${maven.repo.local}/org.apache.axis2/mars/rampart-${rampart_module_version}.mar"/>
<delete includeEmptyDirs="true">
<fileset dir="target/temp-mar"/>
</delete>
</postGoal>
<preGoal name="java:compile">
<j:if test="${context.getVariable('maven.test.skip') != 'true'}">
<j:set var="interop.dir" value="target/interop"/>
<j:set var="work.dir" value="${interop.dir}/work"/>
<j:set var="class.dir" value="${interop.dir}/classes"/>
<mkdir dir="${interop.dir}"/>
<mkdir dir="${work.dir}"/>
<mkdir dir="${class.dir}"/>
<!-- Run WSDL2Java -->
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="maven.dependency.classpath"/>
<arg value="-uri"/>
<arg file="interop/ping.wsdl"/>
<arg value="-ss"/>
<arg value="-o"/>
<arg file="${work.dir}"/>
<arg value="-p"/>
<arg value="org.apache.axis2.oasis.ping"/>
<arg value="-d"/>
<arg value="xmlbeans"/>
<arg value="-g"/>
</java>
<!-- move/copy schema stuff into class.dir -->
<ant:move todir="${class.dir}">
<ant:fileset dir="${work.dir}/resources">
<ant:include name="**/schema*/**/*.xsb"/>
<ant:include name="**/schema*/**/*.class"/>
</ant:fileset>
</ant:move>
<!-- copy the service impl -->
<copy file="interop/org/apache/axis2/oasis/ping/PingPortSkeleton.java"
tofile="${work.dir}/src/org/apache/axis2/oasis/ping/PingPortSkeleton.java" overwrite="yes"/>
<!-- Password callback class for the interop service -->
<copy file="test-resources/PWCallback.java"
tofile="${work.dir}/src/org/apache/axis2/security/PWCallback.java" overwrite="yes"/>
<!-- Interop client -->
<copy file="interop/org/apache/axis2/security/InteropScenarioClient.java"
tofile="${work.dir}/src/org/apache/axis2/security/InteropScenarioClient.java" overwrite="yes"/>
<copy toDir="target/classes/META-INF/">
<fileset dir="src/META-INF">
<include name="**/services/*"/>
</fileset>
</copy>
<ant:path id="classes.dir" location="${class.dir}"/>
<maven:addPath id="maven.dependency.classpath" refid="classes.dir"/>
<ant:path id="src.dir" location="${work.dir}/src"/>
<maven:addPath id="maven.compile.src.set" refid="src.dir"/>
</j:if>
</preGoal>
<!--Create the service.aar" -->
<postGoal name="java:compile">
<j:if test="${context.getVariable('maven.test.skip') != 'true'}">
<!-- move/copy interop classes into class.dir -->
<ant:move todir="${class.dir}">
<ant:fileset dir="${basedir}/target/classes">
<ant:include name="**/ping/**/*.class"/>
<ant:include name="**/oasisOpen/**/*.class"/>
<ant:include name="**/xmlmime/**/*.class"/>
<ant:include name="**/PWCallback.class"/>
<ant:include name="**/InteropScenarioClient.class"/>
</ant:fileset>
</ant:move>
<delete includeEmptyDirs="true">
<fileset dir="${basedir}/target/classes/org/apache/axis2/oasis/"/>
<!--<fileset dir="${basedir}/target/classes/org/xmlsoap/"/>-->
<!--<fileset dir="${basedir}/target/classes/org/oasisOpen/"/>-->
</delete>
<j:set var="interop.dir" value="target/interop"/>
<j:set var="work.dir" value="${interop.dir}/work"/>
<j:set var="class.dir" value="${interop.dir}/classes"/>
<!-- Create the META-INF directory -->
<mkdir dir="${class.dir}/META-INF"/>
<!-- copy the services.xml-->
<copy file="interop/services.xml"
tofile="${class.dir}/META-INF/services.xml" overwrite="yes"/>
<!-- copy axis2.crypto.properties -->
<copy file="interop/axis2.crypto.properties"
tofile="${class.dir}/axis2.crypto.properties" overwrite="yes"/>
<!-- copy axis2.saml.properties -->
<copy file="interop/axis2.saml.properties"
tofile="${class.dir}/axis2.saml.properties" overwrite="yes"/>
<!-- copy axis2.saml3.properties -->
<copy file="interop/axis2.saml3.properties"
tofile="${class.dir}/axis2.saml3.properties" overwrite="yes"/>
<!-- copy axis2.saml4.properties -->
<copy file="interop/axis2.saml4.properties"
tofile="${class.dir}/axis2.saml4.properties" overwrite="yes"/>
<!-- copy x509.PFX.MSFT -->
<copy file="interop/x509.PFX.MSFT"
tofile="${class.dir}/x509.PFX.MSFT" overwrite="yes"/>
<!-- Copy interop.properties-->
<copy file="interop/interop.properties"
tofile="${class.dir}/interop.properties" overwrite="yes"/>
<!-- Copy interop.jks -->
<copy file="interop/interop2.jks"
tofile="${class.dir}/interop2.jks" overwrite="yes"/>
<jar jarfile="target/PingPort.aar" basedir="target/interop/classes">
<include name="**/*"/>
</jar>
</j:if>
</postGoal>
<preGoal name="jar:jar">
<mkdir dir="target/classes/META-INF/services"/>
<copy toDir="target/classes/META-INF/services" overwrite="yes">
<fileset dir="src/META-INF/services" />
</copy>
<j:if test="${context.getVariable('maven.test.skip') != 'true'}">
<delete includeEmptyDirs="true">
<fileset dir="target/classes/org/xmlsoap/"/>
<fileset dir="target/classes/org/oasis_open/"/>
<fileset dir="target/classes/org/w3/"/>
<fileset file="target/classes/org/apache/axis2/security/InteropScenarioClient.class"/>
</delete>
</j:if>
</preGoal>
</project>