]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3950 Make pom.xml of ws-client more maintainable
authorJulien HENRY <julien.henry@sonarsource.com>
Mon, 12 Nov 2012 16:12:47 +0000 (17:12 +0100)
committerJulien HENRY <julien.henry@sonarsource.com>
Mon, 12 Nov 2012 16:16:42 +0000 (17:16 +0100)
 - Fix indent
 - Use property to enforce same version of Maven deps and OSGI Resuire-Bundle
 - remove scope=provided as optional=true is enough

sonar-ws-client/pom.xml

index 435db7abccfcd0ff328f55ca40d1b3693e15de45..0ff26169da545810768ab635f8dcaa738254580b 100644 (file)
@@ -1,5 +1,6 @@
 <?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">
+<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>
   <name>Sonar :: Web Service Client</name>
   <description>Java library to request Sonar web services</description>
 
+  <properties>
+    <httpclient4.version>4.2.2</httpclient4.version>
+  </properties>
+
   <dependencies>
+  <!-- Don't forget to update configuration of the m-bundle-p (especially Require-Bundle)
+  according to changes you make on dependencies -->
     <dependency>
       <groupId>com.googlecode.json-simple</groupId>
       <artifactId>json-simple</artifactId>
       <groupId>commons-httpclient</groupId>
       <artifactId>commons-httpclient</artifactId>
       <version>3.1</version>
-      <scope>provided</scope>
       <optional>true</optional>
     </dependency>
     <dependency>
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpclient</artifactId>
-      <version>4.2.1</version>
-      <scope>provided</scope>
+      <version>${httpclient4.version}</version>
       <optional>true</optional>
     </dependency>
 
 
   <build>
     <plugins>
-        <plugin>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>maven-bundle-plugin</artifactId>
-            <version>2.3.7</version>
-            <extensions>true</extensions>
-            <configuration>
-                <instructions>
-                    <Import-Package>!*</Import-Package>
-                    <Require-Bundle>org.apache.httpcomponents.httpclient;bundle-version="4.2.2";optional="true",
-                    org.apache.httpcomponents.httpcore;bundle-version="4.2.2";optional="true",
-                    com.googlecode.json-simple
-                    </Require-Bundle>
-                    <Export-Package>!.,org.sonar.wsclient,
-                    org.sonar.wsclient.connectors,
-                    org.sonar.wsclient.services</Export-Package>
-                </instructions>
-            </configuration>
-            <executions>
-                <execution>
-                    <id>bundle-manifest</id>
-                    <phase>process-classes</phase>
-                    <goals>
-                        <goal>manifest</goal>
-                    </goals>
-                </execution>
-            </executions>
-        </plugin>
-        <plugin>
-            <artifactId>maven-jar-plugin</artifactId>
-            <configuration>
-                <archive>
-                    <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
-                </archive>
-            </configuration>
-        </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>2.3.7</version>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Import-Package>!*</Import-Package>
+            <Require-Bundle>org.apache.httpcomponents.httpclient;bundle-version="${httpclient4.version}";optional="true",
+              org.apache.httpcomponents.httpcore;bundle-version="${httpclient4.version}";optional="true",
+              com.googlecode.json-simple
+            </Require-Bundle>
+            <Export-Package>!.,org.sonar.wsclient,
+              org.sonar.wsclient.connectors,
+              org.sonar.wsclient.services</Export-Package>
+          </instructions>
+        </configuration>
+        <executions>
+          <execution>
+            <id>bundle-manifest</id>
+            <phase>process-classes</phase>
+            <goals>
+              <goal>manifest</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+          </archive>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 </project>