]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6370 Shade and relocate Guava, GSON and Apache Commons into sonar-plugin-api
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 22 May 2015 14:21:35 +0000 (16:21 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 28 May 2015 07:28:37 +0000 (09:28 +0200)
plugins/sonar-email-notifications-plugin/pom.xml
plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationsPlugin.java
plugins/sonar-l10n-en-plugin/pom.xml
plugins/sonar-xoo-plugin/pom.xml
sonar-core/pom.xml
sonar-plugin-api/pom.xml

index 35e83bda58b23e5acbe1db72e0f9ee650025e19c..830da5e07471c5a0605a606a17b04bc58b75e82c 100644 (file)
   <description>Email Notifications</description>
 
   <dependencies>
+    <dependency>
+      <groupId>com.google.code.findbugs</groupId>
+      <artifactId>jsr305</artifactId>
+      <scope>provided</scope>
+    </dependency>
     <dependency>
       <groupId>org.codehaus.sonar</groupId>
       <artifactId>sonar-plugin-api</artifactId>
index 4d0738def073e56b31991a62e3c3192ac20deb75..fefc33e291682d8f7aa00331ffd5705177c65b02 100644 (file)
  */
 package org.sonar.plugins.emailnotifications;
 
-import com.google.common.collect.ImmutableList;
-import org.sonar.api.SonarPlugin;
-
+import java.util.Arrays;
 import java.util.List;
+import org.sonar.api.SonarPlugin;
 
 public class EmailNotificationsPlugin extends SonarPlugin {
   @Override
   public List getExtensions() {
-    return ImmutableList.of(
+    return Arrays.asList(
       EmailNotificationChannel.class,
 
       // Email templates
index 817eb99e3759ca4e410819c64769dd501461cf2e..49163bca0f7d00d37597870092ebc5ad03211b96 100644 (file)
   <name>SonarQube :: Plugins :: English Pack</name>
 
   <dependencies>
+    <dependency>
+      <groupId>com.google.code.findbugs</groupId>
+      <artifactId>jsr305</artifactId>
+      <scope>provided</scope>
+    </dependency>
     <dependency>
       <groupId>org.codehaus.sonar</groupId>
       <artifactId>sonar-plugin-api</artifactId>
index 26dddfe9e712e0874173ae604844b42b3feeb768..b46b87db14898108e76da1d6dd898e93def89293 100644 (file)
   <description>Sample of plugin to document and test available APIs</description>
 
   <dependencies>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>10.0.1</version>
+    </dependency>
     <dependency>
       <groupId>com.google.code.findbugs</groupId>
       <artifactId>jsr305</artifactId>
index d0a816d282e908c7f8d5ac1bac7e5e521fbadc87..00599ab710ce31981bb24d9ddf67d4d1df1e7882 100644 (file)
       <artifactId>jsr305</artifactId>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.picocontainer</groupId>
       <artifactId>picocontainer</artifactId>
index 06185b4c0a134ea283346e2b4649dba24e1c5140..f3e2d0bd2a7d937c222d06cd44fd269316156175 100644 (file)
     <dependency>
       <groupId>com.google.code.gson</groupId>
       <artifactId>gson</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>jfree</groupId>
-      <artifactId>jfreechart</artifactId>
     </dependency>
     <dependency>
-      <groupId>com.google.code.findbugs</groupId>
-      <artifactId>jsr305</artifactId>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
     </dependency>
     <dependency>
       <groupId>org.codehaus.sonar</groupId>
         </exclusion>
       </exclusions>
     </dependency>
+
+    <dependency>
+      <groupId>jfree</groupId>
+      <artifactId>jfreechart</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.google.code.findbugs</groupId>
+      <artifactId>jsr305</artifactId>
+      <scope>provided</scope>
+    </dependency>
     <dependency>
       <groupId>org.codehaus.sonar</groupId>
       <artifactId>sonar-graph</artifactId>
       </exclusions>
     </dependency>
 
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-    </dependency>
 
     <!-- TODO remove dependencies on Maven
     but for now they should be defined with scope provided
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
       <optional>true</optional>
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>xpp3</groupId>
       <groupId>javax.servlet</groupId>
       <artifactId>javax.servlet-api</artifactId>
       <version>3.0.1</version>
+      <scope>provided</scope>
       <optional>true</optional>
     </dependency>
     <dependency>
       <groupId>ch.qos.logback</groupId>
       <artifactId>logback-classic</artifactId>
+      <scope>provided</scope>
       <optional>true</optional>
     </dependency>
     <dependency>
       <groupId>ch.qos.logback</groupId>
       <artifactId>logback-core</artifactId>
+      <scope>provided</scope>
       <optional>true</optional>
     </dependency>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
+      <scope>provided</scope>
       <optional>true</optional>
     </dependency>
 
 
   <build>
     <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <minimizeJar>true</minimizeJar>
+              <createDependencyReducedPom>true</createDependencyReducedPom>
+              <artifactSet>
+                <excludes>
+                  <exclude>org.codehaus.sonar:sonar-duplications</exclude>
+                  <exclude>org.codehaus.sonar:sonar-channel</exclude>
+                  <exclude>org.codehaus.sonar:sonar-colorizer</exclude>
+                  <exclude>org.codehaus.sonar:sonar-check-api</exclude>
+                  <exclude>org.codehaus.sonar.plugins:sonar-email-notifications-plugin</exclude>
+                  <exclude>org.codehaus.woodstox:woodstox-core-lgpl</exclude>
+                  <exclude>org.codehaus.woodstox:stax2-api</exclude>
+                  <exclude>org.codehaus.staxmate:staxmate</exclude>
+                </excludes>
+              </artifactSet>
+              <relocations>
+                <relocation>
+                  <pattern>com.google</pattern>
+                  <shadedPattern>org.sonar.api.internal.google</shadedPattern>
+                </relocation>
+                <relocation>
+                  <pattern>org.apache.commons</pattern>
+                  <shadedPattern>org.sonar.api.internal.apachecommons</shadedPattern>
+                </relocation>
+              </relocations>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>