summaryrefslogtreecommitdiffstats
path: root/src/main/webapp/WEB-INF/extra/jetty_gerrit.xml
blob: 9b1f943367f0078feb60bcfdff1f39b6bf645957 (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
61
62
63
64
65
66
67
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<!--

  Jetty configuration to place "gerrit.war" into the root context,
  so it answers to old-style URLs like "/$changeid" and "/mine".

  * Copy this file to $JETTY_HOME/contexts/gerrit.xml
  * Edit user, password, jdbcUrl as necessary below for database.
  * Edit mail.smtp.host, user, password as necessary for outgoing SMTP.

  * Copy jdbc/c3p0-0.9.1.2.jar       to $JETTY_HOME/lib/plus/
  * Copy jdbc/postgresql-*.jdbc*.jar to $JETTY_HOME/lib/plus/
  * Copy www/gerrit-*.war            to $JETTY_HOME/webapps/gerrit.war

  * Make sure you remove $JETTY_HOME/context/test.xml

-->
<Configure id="wac" class="org.mortbay.jetty.webapp.WebAppContext">
  <Set name="contextPath">/</Set>
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/gerrit.war</Set>

  <Set name="extractWAR">true</Set>
  <Set name="copyWebDir">true</Set>
  <Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>

  <Set name="ConfigurationClasses">
    <Array type="java.lang.String">
      <Item>org.mortbay.jetty.webapp.WebInfConfiguration</Item>
      <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration</Item>
      <Item>org.mortbay.jetty.plus.webapp.Configuration</Item>
      <Item>org.mortbay.jetty.webapp.JettyWebXmlConfiguration</Item>
    </Array>
  </Set>

  <New id="ReviewDb" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg></Arg>
    <Arg>jdbc/ReviewDb</Arg>
    <Arg>
      <New class="com.mchange.v2.c3p0.ComboPooledDataSource">
        <Set name="driverClass">org.postgresql.Driver</Set>
        <Set name="jdbcUrl">jdbc:postgresql:reviewdb</Set>
        <Set name="user">gerrit2</Set>
        <Set name="password">secretkey</Set>
      </New>
    </Arg>
  </New>

  <New id="OutgoingSmtp" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg></Arg>
    <Arg>mail/Outgoing</Arg>
    <Arg>
      <New class="org.mortbay.naming.factories.MailSessionReference">
        <Set name="properties">
          <New class="java.util.Properties">
            <Put name="mail.smtp.host">localhost</Put>
            <Put name="mail.smtp.port">25</Put>
          </New>
        </Set>
        <!-- Uncomment if you need to authenticate to your SMTP server.
        <Set name="user">gerrit2</Set>
        <Set name="password">secretkey</Set>
             /Uncomment -->
      </New>
    </Arg>
  </New>
</Configure>