blob: 7f8a04b6170c53f522b96a18f355a1d2b8df112e [file] [log] [blame]
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<project name="glassfish-embedded-all" default="create.distribution" basedir=".">
<property name="rootdir" value="target"/>
<property name="zipdir" value="${rootdir}/packager_zips"/>
<property name="jardir" value="${rootdir}/packager_jars"/>
<property name="gfdir" value="${jardir}/${install.dir.name}/glassfish"/>
<property name="modulesdir" value="${gfdir}/modules"/>
<property name="filedir" value="${rootdir}/packager_files"/>
<target name="get.distribution.type">
<condition property="full.distribution">
<equals arg1="${bundlename}" arg2="org.glassfish.main.embedded.all"/>
</condition>
<condition property="web.distribution">
<equals arg1="${bundlename}" arg2="org.glassfish.main.embedded.web"/>
</condition>
<condition property="nucleus.distribution">
<equals arg1="${bundlename}" arg2="org.glassfish.main.embedded.nucleus"/>
</condition>
</target>
<target name="create.distribution" depends="get.distribution.type">
<antcall target="makeJarDir"/>
<antcall target="removeJarsNotNeeded"/>
<antcall target="addDtds"/>
<antcall target="addRars"/>
<antcall target="addEjbTimer"/>
<antcall target="rejar"/>
<attachArtifact file="${finaljar}"/>
</target>
<target name="makeJarDir">
<echo message="creating jar directory..."/>
<copy todir="${jardir}">
<fileset dir="${zipdir}">
<include name="*.jar"/>
</fileset>
</copy>
<!-- The packager files are zips with jars inside -->
<unzip dest="${jardir}">
<fileset dir="${zipdir}">
<include name="*.zip"/>
<exclude name="mq**.zip"/>
<exclude name="derby**.zip"/>
</fileset>
</unzip>
<unzip dest="${jardir}/javadb">
<fileset dir="${zipdir}">
<include name="derby**.zip"/>
</fileset>
<patternset>
<include name="**/lib/**"/>
<include name="**/bin/**"/>
</patternset>
</unzip>
<mkdir dir="${rootdir}/temp"/>
</target>
<target name="removeJarsNotNeeded">
<delete verbose="true" failonerror="true">
<fileset dir="${jardir}" includes="ant-**.jar"/>
<fileset dir="${jardir}" includes="weld-se-shaded**.jar"/>
</delete>
<delete file="${modulesdir}/autostart/osgi-cdi.jar" failonerror="false"/>
</target>
<target name="addDtds" unless="nucleus.distribution">
<echo message="adding dtds"/>
<jar jarfile="${jardir}/dtds.jar" basedir="${jardir}/glassfish/lib" includes="dtds/**/*"/>
<jar jarfile="${jardir}/schemas.jar" basedir="${jardir}/glassfish/lib" includes="schemas/**/*"/>
<jar jarfile="${jardir}/nucleus-dtds.jar" basedir="${jardir}/lib" includes="dtds/**/*"/>
<jar jarfile="${jardir}/nucleus-schemas.jar" basedir="${jardir}/lib" includes="schemas/**/*"/>
</target>
<target name="rejar">
<echo message="rejarring and processing metadata..."/>
<taskdef name="rejar" classname="org.jvnet.maven.plugin.antrun.RejarTask" />
<defaultexcludes add="META-INF/**.RSA"/>
<defaultexcludes add="META-INF/**.inf"/>
<defaultexcludes add="META-INF/**.SF"/>
<rejar destfile="${finaljar}" duplicate="preserve" >
<manifest>
<attribute name="Bundle-SymbolicName" value="${bundlename}"/>
<attribute name="Main-Class" value="com.sun.enterprise.glassfish.bootstrap.UberMain"/>
</manifest>
<zipgroupfileset dir="${jardir}" includes="**/*.jar"/>
<fileset dir="${rootdir}/temp" includes="*.rar, *.war"/>
</rejar>
</target>
<target name="addExtraRars" if="full.distribution">
<echo message="Adding additional rars"/>
<!-- Include property files i.e., glassfish6/mq/lib/props/broker/*.properties of mq.zip in jmsra.rar -->
<unzip dest="${jardir}">
<fileset dir="${zipdir}">
<include name="mq**.zip"/>
</fileset>
<patternset>
<include name="**/props/broker/**"/>
</patternset>
</unzip>
<move file="${jardir}/mq/lib/props" tofile="${jardir}/glassfish/lib/install/applications/jmsra/props"/>
<delete dir="${jardir}/mq"/>
<jar jarfile="${jardir}/jmsra.rar" basedir="${jardir}/glassfish" includes="lib/install/applications/jmsra/**/*"/>
</target>
<target name="addRars" depends="addExtraRars" unless="nucleus.distribution">
<echo message="adding rars"/>
<jar jarfile="${jardir}/__cp_jdbc_ra.rar" basedir="${jardir}/glassfish" includes="lib/install/applications/__cp_jdbc_ra/**/*"/>
<jar jarfile="${jardir}/__ds_jdbc_ra.rar" basedir="${jardir}/glassfish" includes="lib/install/applications/__ds_jdbc_ra/**/*"/>
<jar jarfile="${jardir}/__dm_jdbc_ra.rar" basedir="${jardir}/glassfish" includes="lib/install/applications/__dm_jdbc_ra/**/*"/>
<jar jarfile="${jardir}/__xa_jdbc_ra.rar" basedir="${jardir}/glassfish" includes="lib/install/applications/__xa_jdbc_ra/**/*"/>
<copy todir="${rootdir}/temp">
<fileset dir="${jardir}">
<include name="*.rar"/>
</fileset>
</copy>
<!-- <jar jarfile="${finaljar}" update="true" basedir="${jardir}" includes="__cp_jdbc_ra.rar, __ds_jdbc_ra.rar, __dm_jdbc_ra.rar, __xa_jdbc_ra.rar"/> -->
</target>
<target name="addEjbTimer" if="full.distribution">
<echo message="adding EJBTimer"/>
<copy file="${jardir}/glassfish/lib/install/applications/ejb-timer-service-app.war" todir= "${rootdir}/temp"/>
<!--
<jar jarfile="${finaljar}" update="true" basedir="${jardir}/glassfish6/glassfish/lib/install/applications" includes="ejb-timer-service-app.war"/>
-->
</target>
</project>