Commits

Sebastian Sdorra committed 79c7e82

disable cdi descovery for webapp, guava and jsersey-guava

Comments (0)

Files changed (5)

     <!-- repostitory libraries -->
     <jgit.version>3.0.0.201306101825-r</jgit.version>
     <svnkit.version>1.7.10-scm3</svnkit.version>
+    
+    <!-- util libraries -->
+    <guava.version>14.0.1</guava.version>
 
     <!-- build properties -->
     <project.build.javaLevel>1.6</project.build.javaLevel>
     <dependency>
       <groupId>com.google.guava</groupId>
       <artifactId>guava</artifactId>
-      <version>14.0.1</version>
+      <version>${guava.version}</version>
     </dependency>
     
     <dependency>

scm-webapp/pom.xml

       <groupId>com.sun.jersey.contribs</groupId>
       <artifactId>jersey-guice</artifactId>
       <version>${jersey.version}</version>
-      <exclusions>
-        <exclusion>
-          <artifactId>jersey-grizzly2</artifactId>
-          <groupId>com.sun.jersey</groupId>
-        </exclusion>
-      </exclusions>
+      <!-- included by dependency rewrite -->
+      <scope>provided</scope>
     </dependency>
     
     <dependency>
       <version>3.3.1</version>
     </dependency>
     
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>${guava.version}</version>
+      <!-- included by dependency rewrite -->
+      <scope>provided</scope>
+    </dependency>
+    
     <!-- template engine -->
 
     <dependency>
           </execution>
         </executions>
       </plugin>
+      
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.6</version>
+        <executions>
+          <execution>
+            <id>repack</id>
+            <phase>compile</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <target>
+                <!--
+                add beans.xml to jersey-guice and guava
+                -->
+                
+                <!-- jersey guice -->
+                
+                <unzip src="${com.sun.jersey.contribs:jersey-guice:jar}" dest="${project.build.directory}/tmp/jersey-guice"/>
+                <copy file="src/main/webapp/WEB-INF/beans.xml" toDir="${project.build.directory}/tmp/jersey-guice/META-INF" />
+                <zip basedir="${project.build.directory}/tmp/jersey-guice" destfile="${project.build.directory}/dependency-rewrite/WEB-INF/lib/jersey-guice-${jersey.version}.jar"/>
+                
+                <!-- guava -->
+                
+                <unzip src="${com.google.guava:guava:jar}" dest="${project.build.directory}/tmp/guava"/>
+                <copy file="src/main/webapp/WEB-INF/beans.xml" toDir="${project.build.directory}/tmp/guava/META-INF" />
+                <zip basedir="${project.build.directory}/tmp/guava" destfile="${project.build.directory}/dependency-rewrite/WEB-INF/lib/guava-${guava.version}.jar"/>
+                
+              </target>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <version>2.2</version>
+        <configuration>
+          <webResources>
+            <resource>
+              <directory>${project.build.directory}/dependency-rewrite</directory>
+            </resource>
+          </webResources>
+        </configuration>
+      </plugin>
 
       <plugin>
         <groupId>sonia.maven</groupId>

scm-webapp/src/main/webapp/WEB-INF/beans.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
+       bean-discovery-mode="none">
+</beans>

scm-webapp/src/main/webapp/WEB-INF/web.xml

 
 <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
+         metadata-complete="true">
 
     <listener>
       <listener-class>sonia.scm.boot.BootstrapListener</listener-class>