PageRenderTime 18ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/asl/asl-java-war.xml

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
XML | 81 lines | 42 code | 9 blank | 30 comment | 0 complexity | 62f75d2be519c559c1070bf46866b026 MD5 | raw file
Possible License(s): LGPL-3.0, Apache-2.0, GPL-3.0, GPL-2.0, AGPL-3.0, JSON, BSD-3-Clause
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. ********************************************************************************
  4. * Ant Script Library - Java war module
  5. * Targets to create a war
  6. * Module property prefix: "java-war"
  7. ********************************************************************************
  8. * Copyright 2009 Joe Schmetzer
  9. *
  10. * Licensed under the Apache License, Version 2.0 (the "License");
  11. * you may not use this file except in compliance with the License.
  12. * You may obtain a copy of the License at
  13. *
  14. * http://www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an "AS IS" BASIS,
  18. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. * See the License for the specific language governing permissions and
  20. * limitations under the License.
  21. ********************************************************************************
  22. -->
  23. <project name="asl-java-war">
  24. <dirname property="asl-java-war.basedir" file="${ant.file.asl-java-war}"/>
  25. <import file="${asl-java-war.basedir}/asl-java-build.xml"/>
  26. <property name="java-war.dist-filename" value="${ant.project.name}.war"/>
  27. <property name="java-war.dist-file" location="${common.dist-dir}/${java-war.dist-filename}"/>
  28. <property name="java-war.web-xml-file" location="src/metadata/myapp.xml"/>
  29. <property name="java-war.libs-dir" location="${common.target-dir}/war-libs"/>
  30. <property name="java-war.web-content-dir" location="src/main/webapp"/>
  31. <property name="java-war.web-xml" location="web.xml"/>
  32. <property name="java-war.webapp-name" location="${ant.project.name}"/>
  33. <property name="java-war.deploy-base" location="${tomcat.home}/webapps"/>
  34. <property name="java-war.deploy-dir" location="${java-war.deploy-base}/${java-war.webapp-name}"/>
  35. <!-- ***********************************************************************
  36. * target: war
  37. ************************************************************************ -->
  38. <target name="war" depends="compile, copy-resources, jar, -init-time, -war-prepare-libs"
  39. description="Create a war for this web project">
  40. <mkdir dir="${common.dist-dir}"/>
  41. <property name="java-war.compress" value="true"/>
  42. <property name="java-war.build-id" value="Built by ${user.name} at ${common.timestamp} running on ${os.name} ${os.version} ${os.arch}"/>
  43. <war destfile="${java-war.dist-file}"
  44. webxml="${java-war.web-xml-file}"
  45. compress="${java-war.compress}">
  46. <fileset dir="${java-war.web-content-dir}" />
  47. <manifest>
  48. <attribute name="Build-Id" value="${java-war.build-id}"/>
  49. </manifest>
  50. <lib dir="${java-war.libs-dir}"/>
  51. </war>
  52. </target>
  53. <!-- ***********************************************************************
  54. * target: -war-prepare-libs
  55. ************************************************************************ -->
  56. <target name="-war-prepare-libs">
  57. <mkdir dir="${java-war.libs-dir}"/>
  58. <copy todir="${java-war.libs-dir}">
  59. <path refid="java-build.classpath"/>
  60. <mapper type="flatten"/>
  61. </copy>
  62. <copy todir="${java-war.libs-dir}" file="${java-build.jar-file}"/>
  63. </target>
  64. <!-- ***********************************************************************
  65. * target: war-deploy
  66. ************************************************************************ -->
  67. <target name="war-deploy" depends="war"
  68. description="Deploys the war to the application server">
  69. <unwar src="${java-war.dist-file}"
  70. dest="${java-war.deploy-dir}"/>
  71. </target>
  72. </project>