openam-server-prepare-war.xml revision 45f9dd659662438906486dcfa7ef29055e9a1ee6
<?xml version="1.0" encoding="UTF-8"?>
<!--
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2011-2016 ForgeRock AS.
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* http://forgerock.org/license/CDDLv1.0.html
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at http://forgerock.org/license/CDDLv1.0.html
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
-->
<!-- Parent Project -->
<project name="openam-server-war-preparation" default="openam_server-prepare-war">
<description>OpenAM Server Prepare WAR ANT Script</description>
<target name="openam-server-prepare-war">
<tstamp>
<format property="war.time.stamp" pattern="yyyy-MMMM-dd HH:mm" locale="en,UK"/>
</tstamp>
<property name="version.set" value="${openam.version}"/>
<property name="opendj.repackage.dir" value="${project.build.directory}/repackage-opendj"/>
<filter token="DATESTAMP" value="${war.time.stamp}"/>
<filter token="VERSION" value="${version.set}"/>
<filter token="REVISION" value="${git.short.sha1}"/>
<mkdir dir="${openam.temp.target}"/>
<mkdir dir="${project.build.directory}/classes"/>
<mkdir dir="${project.build.directory}/openam"/>
<mkdir dir="${openam.temp.target}/WEB-INF/template/opendj"/>
<!-- OpenDJ 3.0: Note - Repackage Sequence depends on Maven to locate the appropriate dependency -->
<!-- OpenDJ 3.0: Clean unpack folder -->
<delete dir="${opendj.repackage.dir}" failonerror="false"/>
<mkdir dir="${opendj.repackage.dir}"/>
<!-- OpenDJ 3.0: Unpack the zip in preparation for running the script -->
<unzip dest="${opendj.repackage.dir}">
<fileset dir="${project.build.directory}">
<include name="opendj-server-legacy*.zip"/>
</fileset>
</unzip>
<!-- OpenDJ 3.0: Copy in scripts and associated resources -->
<copy todir="${opendj.repackage.dir}/opendj/template/ldif">
<fileset dir="/openam-distribution/src/main/opendj">
<include name="openam_suffix.ldif.template"/>
</fileset>
</copy>
<!-- OpenDJ 3.0: Perform OpenDJ mangling! -->
<!-- Remove the block starting with 'dn: cn=SNMP' and terminated by a blank line -->
<replaceregexp file="${opendj.repackage.dir}/opendj/template/config/config.ldif"
match="^dn: cn=SNMP.*?^$" replace="" byline="false" flags="m" />
<!-- Add a config.ldif.${VERSION_NO} file to the upgrade directory for easy upgrading from
Pre-OPENDJ2.4.5 versions -->
<path id="config.version.path">
<fileset dir="${opendj.repackage.dir}/opendj/template/config/upgrade">
<include name="*"/>
</fileset>
</path>
<property name="config.version.file" refid="config.version.path"/>
<ac:propertyregex property="config.version" input="${config.version.file}" regexp=".*\.([^\.]+)$" select="\1"
xmlns:ac="antlib:net.sf.antcontrib"/>
<echo message="Config version: ${config.version}"/>
<copy todir="${opendj.repackage.dir}/opendj/template/config/upgrade/">
<fileset dir="${opendj.repackage.dir}/opendj/template/config">
<include name="config.ldif"/>
</fileset>
<globmapper from="*" to="*.${config.version}"/>
</copy>
<!-- Exclusion List will extract out of the OpenDJ distribution files which do not make sense to include -->
<zip destfile="${opendj.repackage.dir}/opendj.zip"
basedir="${opendj.repackage.dir}/opendj"
excludesfile="/openam-distribution/src/main/opendj/${exclusion.list}"/>
<!-- OpenDJ 3.0: Deliver re-packaged zip to expected location -->
<copy todir="${openam.temp.target}/WEB-INF/template/opendj" filtering="false">
<fileset dir="${project.build.directory}/repackage-opendj">
<include name="opendj.zip"/>
</fileset>
</copy>
<mkdir dir="${openam.temp.target}/config/federation/default_en"/>
<copy todir="${openam.temp.target}/config/federation/default_en" filtering="true">
<fileset dir="${project.basedir}/src/main/webapp/config/federation/default">
<include name="**/**" />
</fileset>
</copy>
<!-- Align in fedlet -->
<mkdir dir="${openam.temp.target}/WEB-INF/fedlet/AG/com/sun/identity/fedlet/ag"/>
<copy todir="${openam.temp.target}/WEB-INF/fedlet/AG/com/sun/identity/fedlet/ag/"
filtering="false">
<fileset
dir="${project.basedir}/openam-federation/openam-federation-library/target/classes/com/sun/identity/fedlet/ag">
<include name="UserData.class"/>
<include name="AssertionGen.class"/>
<include name="MetaDataParser.class"/>
</fileset>
</copy>
<copy todir="${openam.temp.target}/WEB-INF/fedlet" filtering="false">
<fileset dir="src/main/resources">
<include name="FederationConfig.properties"/>
</fileset>
</copy>
<!-- Align in auth -->
<mkdir dir="${openam.temp.target}/config/auth"/>
<copy todir="${openam.temp.target}/config/auth/default_en" flatten="true">
<fileset dir="src/main/webapp/config/auth/default" includes="*.xml"/>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_de" flatten="true">
<fileset dir="src/main/webapp/config/auth/default_de" includes="*.xml"/>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_es" flatten="true">
<fileset dir="src/main/webapp/config/auth/default_es" includes="*.xml"/>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_fr" flatten="true">
<fileset dir="src/main/webapp/config/auth/default_fr" includes="*.xml"/>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_ja" flatten="true">
<fileset dir="src/main/webapp/config/auth/default_ja" includes="*.xml"/>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_ko" flatten="true">
<fileset dir="src/main/webapp/config/auth/default_ko" includes="*.xml"/>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_zh" flatten="true">
<fileset dir="src/main/webapp/config/auth/default_zh_CN" includes="*.xml"/>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_zh_CN" flatten="true">
<fileset dir="src/main/webapp/config/auth/default_zh_CN" includes="*.xml"/>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_zh_TW" flatten="true">
<fileset dir="src/main/webapp/config/auth/default_zh_TW" includes="*.xml"/>
</copy>
<copy todir="${openam.temp.target}/config/auth/default" filtering="false" overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_en" filtering="false"
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_de" filtering="false"
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_es" filtering="false"
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_fr" filtering="false"
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_ja" filtering="false"
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_ko" filtering="false"
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_zh" filtering="false"
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_zh_CN" filtering="false"
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
<copy todir="${openam.temp.target}/config/auth/default_zh_TW" filtering="false"
overwrite="false">
<fileset
dir="${project.basedir}/openam-federation/OpenFM/src/main/resources/xml/auth-module">
<include name="*.*"/>
</fileset>
</copy>
<!-- Align the Service Definitions for WAR Inclusion. -->
<copy todir="${project.build.directory}/classes" overwrite="false">
<fileset dir="${server.resources}/services">
<include name="*.*"/>
<exclude name="amAuth.xml"/>
</fileset>
</copy>
<!-- Align the Config Definitions for WAR Inclusion. -->
<copy todir="${project.build.directory}/classes" overwrite="true" filtering="true">
<fileset dir="${server.resources}/config">
<include name="*.htm"/>
<include name="*.properties"/>
<include name="license.txt"/>
<exclude name="serviceNames.properties"/>
</fileset>
</copy>
<copy todir="${project.build.directory}/classes" overwrite="false" filtering="true">
<fileset dir="${project.basedir}/src/main/webapp/WEB-INF/template/sms">
<include name="*.*"/>
</fileset>
</copy>
<!-- Remaining Bits -->
<copy todir="${openam.temp.target}/config" overwrite="true" filtering="true">
<fileset dir="${server.resources}/config">
<include name="*.htm"/>
</fileset>
</copy>
<mkdir dir="${openam.temp.target}/js"/>
<copy todir="${openam.temp.target}/js" overwrite="true">
<fileset dir="src/main/webapp/com_sun_web_ui/js">
<include name="browserVersion.js"/>
</fileset>
</copy>
</target>
</project>