]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3150 Reduce size of PMD and FindBugs plugins
authorEvgeny Mandrikov <mandrikov@gmail.com>
Sun, 8 Jan 2012 17:27:44 +0000 (21:27 +0400)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Sun, 8 Jan 2012 20:09:04 +0000 (00:09 +0400)
* Remove unused dependencies

* Lock size with help of maven-enforcer-plugin to prevent future
  regressions

plugins/sonar-findbugs-plugin/pom.xml
plugins/sonar-pmd-plugin/pom.xml

index 74086f1b1c4268dfb998daf12ac71a8326fc8030..c25e0164383db3a68c9db055ab96c474ad6fd0dd 100644 (file)
     <findbugs.version>1.3.9</findbugs.version>
   </properties>
 
-  <!-- IMPORTANT!
-  xalan should be excluded everywhere, because contains Apache BCEL,
-  but FindBugs requires its own version of BCEL - see http://findbugs.sourceforge.net/FAQ.html#q2  
-  -->
-
-  <dependencyManagement>
-    <!-- Change versions for dependencies provided by sonar-plugin-api -->
-    <dependencies>
-      <dependency>
-        <groupId>xerces</groupId>
-        <artifactId>xercesImpl</artifactId>
-        <version>2.6.2</version>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
-
   <dependencies>
+    <!--
+    !!! ORDER OF DEPENDENCIES IS IMPORTANT !!!
+    FindBugs should be first
+    -->
+
     <dependency>
-      <groupId>org.codehaus.sonar</groupId>
-      <artifactId>sonar-plugin-api</artifactId>
-      <scope>provided</scope>
+      <groupId>com.google.code.findbugs</groupId>
+      <artifactId>findbugs</artifactId>
+      <version>${findbugs.version}</version>
       <exclusions>
         <exclusion>
-          <groupId>xalan</groupId>
-          <artifactId>xalan</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>jaxen</groupId>
-          <artifactId>jaxen</artifactId>
+          <groupId>jdom</groupId>
+          <artifactId>jdom</artifactId>
         </exclusion>
         <exclusion>
-          <groupId>dom4j</groupId>
-          <artifactId>dom4j</artifactId>
+          <groupId>xml-apis</groupId>
+          <artifactId>xml-apis</artifactId>
         </exclusion>
         <exclusion>
           <groupId>xerces</groupId>
           <artifactId>xercesImpl</artifactId>
         </exclusion>
+        <exclusion>
+          <groupId>xom</groupId>
+          <artifactId>xom</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
+
     <dependency>
-      <groupId>com.google.code.findbugs</groupId>
-      <artifactId>findbugs</artifactId>
-      <version>${findbugs.version}</version>
+      <groupId>org.codehaus.sonar</groupId>
+      <artifactId>sonar-plugin-api</artifactId>
+      <scope>provided</scope>
       <exclusions>
+        <!-- allows to package dom4j into plugin -->
         <exclusion>
-          <groupId>xalan</groupId>
-          <artifactId>xalan</artifactId>
+          <groupId>dom4j</groupId>
+          <artifactId>dom4j</artifactId>
         </exclusion>
       </exclusions>
     </dependency>
           <useChildFirstClassLoader>true</useChildFirstClassLoader>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>enforce-plugin-size</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <phase>verify</phase>
+            <configuration>
+              <rules>
+                <requireFilesSize>
+                  <maxsize>4500000</maxsize>
+                  <minsize>4000000</minsize>
+                  <files>
+                    <file>${project.build.directory}/${project.build.finalName}.jar</file>
+                  </files>
+                </requireFilesSize>
+              </rules>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 </project>
index d9bd2f22b0ce26a01d9e40e64640b6478c0935c3..9ef0e735d595d9ee242add0cffcb82660b5a3311 100644 (file)
           <groupId>ant</groupId>
           <artifactId>ant</artifactId>
         </exclusion>
+        <exclusion>
+          <groupId>xom</groupId>
+          <artifactId>xom</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
 
           <pluginClass>org.sonar.plugins.pmd.PmdPlugin</pluginClass>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>enforce-plugin-size</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <phase>verify</phase>
+            <configuration>
+              <rules>
+                <requireFilesSize>
+                  <maxsize>1500000</maxsize>
+                  <minsize>1000000</minsize>
+                  <files>
+                    <file>${project.build.directory}/${project.build.finalName}.jar</file>
+                  </files>
+                </requireFilesSize>
+              </rules>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 </project>