summaryrefslogtreecommitdiffstats
path: root/gerrit-war
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2012-10-21 21:15:36 -0700
committerShawn O. Pearce <sop@google.com>2012-10-21 21:25:25 -0700
commit136d6cc3a5b54196fd63c170da01103c347adf26 (patch)
tree2f4aff3c55ed4b2fc60bf60d8c2861bdcebe3e37 /gerrit-war
parentea48b3c2502bcaa51404175f381f4f34699ee96a (diff)
Remove servlet-api from WAR/lib
It is wrong to include the servlet API in a WAR's WEB-INF/lib directory. This confuses some servlet containers who refuse to load the Gerrit WAR. Instead package the Jetty runtime and the servlet API in a new WEB-INF/pgm-lib directory. Change-Id: Ic5fe14c735e781b2d78d2fa8d0d403a08b7ee21f
Diffstat (limited to 'gerrit-war')
-rw-r--r--gerrit-war/pom.xml55
1 files changed, 55 insertions, 0 deletions
diff --git a/gerrit-war/pom.xml b/gerrit-war/pom.xml
index 3becf84e7c..723d416bb4 100644
--- a/gerrit-war/pom.xml
+++ b/gerrit-war/pom.xml
@@ -41,6 +41,12 @@ limitations under the License.
</dependency>
<dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
<groupId>com.google.gerrit</groupId>
<artifactId>gerrit-gwtui</artifactId>
<version>${project.version}</version>
@@ -99,6 +105,18 @@ limitations under the License.
<groupId>com.google.gerrit</groupId>
<artifactId>gerrit-pgm</artifactId>
<version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-servlet</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-servlet</artifactId>
+ <scope>provided</scope>
</dependency>
</dependencies>
@@ -135,9 +153,46 @@ limitations under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-servlet-api</id>
+ <configuration>
+ <includeGroupIds>org.apache.tomcat,org.eclipse.jetty</includeGroupIds>
+ <excludeArtifactIds>servlet-api</excludeArtifactIds>
+ </configuration>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
+ <id>copy-servlet-api</id>
+ <phase>process-classes</phase>
+ <configuration>
+ <target>
+ <property name="src" location="${project.build.directory}/dependency" />
+ <property name="dst" location="${project.build.directory}/${project.build.finalName}/WEB-INF/pgm-lib" />
+
+ <mkdir dir="${dst}" />
+ <copy overwrite="true" todir="${dst}">
+ <fileset dir="${src}">
+ <include name="*.jar" />
+ </fileset>
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
<id>copy-license</id>
<phase>process-classes</phase>
<configuration>