aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-application/src/main/assembly/war/build.xml
blob: dd7d897a0111ed983ec60fbff6487b2cd4dab4e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!--
Copyright (C) 2008-2012 SonarSource
mailto:contact AT sonarsource DOT com

Sonar is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.

Sonar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with Sonar; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
-->
<project name="Sonar WAR builder" basedir="." default="war">
  <pathconvert targetos="unix" property="sonarHome">
    <path location="${basedir}/.."/>
  </pathconvert>

  <target name="war" depends="clean">
    <mkdir dir="build/sonar-server"/>
    <copy todir="build/sonar-server">
      <fileset dir="sonar-server"/>
    </copy>

    <!-- add JDBC driver to classpath -->
    <copy todir="build/sonar-server/WEB-INF/lib" flatten="true">
      <fileset dir="../extensions/jdbc-driver" includes="**/*.jar"/>
    </copy>

    <replace file="build/sonar-server/WEB-INF/classes/sonar-war.properties" token="#SONAR_HOME=" value="SONAR_HOME=${sonarHome}" />

    <war destfile="sonar.war" webxml="build/sonar-server/WEB-INF/web.xml">
      <fileset dir="build/sonar-server"/>
    </war>

    <echo>
      -----------------------------------------------------------------------------------------------------------
      sonar.war is ready to be deployed. It is linked to the Sonar home directory:
      ${sonarHome}

      IMPORTANT NOTES :
      * supported web servers are Jetty and Tomcat 5.x/6.x/7.x
      * the web application uses the Sonar home directory. For this reason it must be deployed on this host only.
      * the war file must be rebuilt when :
        - the Sonar home directory is moved to other location
        - sonar is upgraded to a new version
      -----------------------------------------------------------------------------------------------------------
    </echo>
  </target>

  <target name="clean">
    <delete dir="build"/>
    <delete file="sonar.war"/>
  </target>
</project>