]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6370 Package deprecated API dependencies in a single JAR.
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 26 May 2015 07:43:25 +0000 (09:43 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 28 May 2015 07:28:59 +0000 (09:28 +0200)
This JAR file contains Guava, GSON and commons-*. It will be declared
in the classloaders of "old" plugins that do not embed their own
versions of these libraries.

pom.xml
sonar-api-deps/pom.xml [new file with mode: 0644]
sonar-core/pom.xml

diff --git a/pom.xml b/pom.xml
index 54c1246703f5a405f343ed85bd78c46be211d9e9..afb2c5c90bee383d30476b4adbed8de6d1df4a82 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -11,6 +11,7 @@
   <description>Open source platform for continuous inspection of code quality</description>
 
   <modules>
+    <module>sonar-api-deps</module>
     <module>sonar-application</module>
     <module>sonar-batch</module>
     <module>sonar-batch-maven-compat</module>
diff --git a/sonar-api-deps/pom.xml b/sonar-api-deps/pom.xml
new file mode 100644 (file)
index 0000000..5c22901
--- /dev/null
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.codehaus.sonar</groupId>
+    <artifactId>sonar</artifactId>
+    <version>5.2-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>sonar-api-deps</artifactId>
+  <packaging>jar</packaging>
+
+  <name>SonarQube :: Plugin API Dependencies</name>
+  <description>Deprecated transitive dependencies of sonar-plugin-api</description>
+  
+  <dependencies>
+    <dependency>
+      <groupId>com.google.code.gson</groupId>
+      <artifactId>gson</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+    </dependency>
+  </dependencies>
+
+  <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>false</minimizeJar>
+              <createDependencyReducedPom>true</createDependencyReducedPom>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
index 00599ab710ce31981bb24d9ddf67d4d1df1e7882..91eb277c5782a8fee7ed7efcad12e1be4d931c35 100644 (file)
       <artifactId>log4j-over-slf4j</artifactId>
     </dependency>
 
+    <dependency>
+      <!-- sonar-api-deps.jar is copied into target JAR file -->
+      <groupId>org.codehaus.sonar</groupId>
+      <artifactId>sonar-api-deps</artifactId>
+      <version>${project.version}</version>
+      <scope>runtime</scope>
+    </dependency>
+
 
     <!-- tests -->
     <dependency>
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>copy-deprecated-api-deps</id>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>copy</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>${project.groupId}</groupId>
+                  <artifactId>sonar-api-deps</artifactId>
+                  <destFileName>sonar-api-deps.jar</destFileName>
+                </artifactItem>
+              </artifactItems>
+              <outputDirectory>${project.build.outputDirectory}</outputDirectory>
+              <overWriteReleases>false</overWriteReleases>
+              <overWriteSnapshots>true</overWriteSnapshots>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>