| <?xml version="1.0"?> |
| <!-- |
| ~ Licensed to the Apache Software Foundation (ASF) under one |
| ~ or more contributor license agreements. See the NOTICE file |
| ~ distributed with this work for additional information |
| ~ regarding copyright ownership. The ASF licenses this file |
| ~ to you under the Apache License, Version 2.0 (the |
| ~ "License"); you may not use this file except in compliance |
| ~ with the License. You may obtain a copy of the License at |
| ~ |
| ~ http://www.apache.org/licenses/LICENSE-2.0 |
| ~ |
| ~ Unless required by applicable law or agreed to in writing, |
| ~ software distributed under the License is distributed on an |
| ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| ~ KIND, either express or implied. See the License for the |
| ~ specific language governing permissions and limitations |
| ~ under the License. |
| --> |
| <project name="samples-web" default="package"> |
| |
| <property name="root.base.dir" value="../.."/> |
| <property name="module.name" value="samples-web"/> |
| <import file="${root.base.dir}/common.ant.xml"/> |
| <property name="dist.jarName" value="${project.name}-${module.name}-${version}"/> |
| <property name="dist.jar" value="${dist.dir}/samples/${dist.jarName}.jar"/> |
| <property name="dist.warName" value="${project.name}-${module.name}-${version}"/> |
| <property name="dist.war" value="${dist.dir}/samples/${dist.warName}.war"/> |
| |
| <path id="compile.path"> |
| <fileset dir="${lib.dir}/samples"> |
| <include name="*.jar"/> |
| </fileset> |
| <fileset dir="${dist.dir}/modules"> |
| <include name="${project.name}-core-${version}.jar"/> |
| <include name="${project.name}-web-${version}.jar"/> |
| </fileset> |
| </path> |
| |
| <!-- =================================================================== |
| clean - clean all build remnants from this submodule |
| ==================================================================== --> |
| <target name="clean-deploy-dir" description="Removes the deployed war directory"> |
| <echo message="cleaning ${dist.warName} module from ${deploy.dir}"/> |
| <delete file="${deploy.dir}/${dist.warName}.war"/> |
| <delete dir="${deploy.dir}/${dist.warName}"/> |
| </target> |
| <target name="clean" depends="clean-deploy-dir" description="Cleans the Spring/Hibernate sample webapp build"> |
| <echo message="cleaning ${module.name} module"/> |
| <delete file="${dist.jar}"/> |
| <delete file="${dist.war}"/> |
| <delete dir="${build.dir}"/> |
| </target> |
| |
| |
| <!-- =================================================================== |
| war - create distribution war (which will be used for deployment) |
| =================================================================== --> |
| <target name="war" description="Creates the samples webapp .war"> |
| <war warfile="${dist.war}" webxml="src/main/webapp/WEB-INF/web.xml"> |
| <lib dir="${root.dist.dir}" includes="jsecurity-*.jar"/> |
| <lib dir="${lib.dir}/samples" includes="jstl-*.jar"/> |
| <lib dir="${lib.dir}/samples" includes="standard-*.jar"/> |
| <lib dir="${lib.dir}/samples" includes="log4j-*.jar"/> |
| <lib dir="${lib.dir}/samples" includes="commons-*.jar"/> |
| <lib dir="${lib.dir}/samples" includes="ehcache-*.jar"/> |
| <lib dir="${lib.dir}/samples" includes="backport-util-concurrent-*.jar"/> |
| <fileset dir="webroot" includes="**" excludes="**/web.xml"/> |
| </war> |
| </target> |
| |
| <target name="package" depends="war"/> |
| |
| <target name="quick-deploy" description="Blindly deploys the sample web .war to Tomcat"> |
| <echo>Deploying application to Tomcat...</echo> |
| <unzip src="${dist.war}" dest="${env.CATALINA_HOME}/webapps/${project.name}-${module.name}"/> |
| <touch file="${env.CATALINA_HOME}/webapps/${project.name}-${module.name}/WEB-INF/web.xml"/> |
| </target> |
| |
| <target name="deploy" depends="package,quick-deploy" |
| description="Creates and deploys the sample web .war to Tomcat"/> |
| |
| </project> |