]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2849 Remove declarations of third-party repositories from root pom
authorEvgeny Mandrikov <mandrikov@gmail.com>
Sat, 1 Oct 2011 01:14:56 +0000 (05:14 +0400)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Wed, 26 Oct 2011 17:33:15 +0000 (21:33 +0400)
Enforce that repositories not declared in pom.xml, except of modules
sonar-checkstyle-plugin and sonar-squid-java-plugin due to dependency
on Checktyle 5.1, which is not available in Central.

This allows to remove side effects in Maven plugins.

plugins/sonar-checkstyle-plugin/pom.xml
plugins/sonar-squid-java-plugin/pom.xml
pom.xml

index ca05ff09557919f0fbda8841c2f4bc046e6ead89..d77722f6d669b46425d428df28e982b1b504a70e 100644 (file)
     <checkstyle.version>5.1</checkstyle.version>
   </properties>
 
+  <repositories>
+    <!-- for checkstyle 5.1 -->
+    <repository>
+      <id>sonar</id>
+      <name>Sonar</name>
+      <url>http://repository.sonarsource.org/content/repositories/sonar</url>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+
   <dependencies>
     <dependency>
       <groupId>org.codehaus.sonar</groupId>
       </testResource>
     </testResources>
     <plugins>
+      <plugin>
+        <!-- TODO remove (see SONAR-2938) -->
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>enforce-no-repositories</id>
+            <configuration>
+              <skip>true</skip>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+
       <plugin>
         <groupId>org.codehaus.sonar</groupId>
         <artifactId>sonar-packaging-maven-plugin</artifactId>
index 11b76dbdf15bafdf1abe87a0d1de0cacd0225387..e3920ee4d9bbc6db7627e59dc1ed8d2fe8e765c7 100644 (file)
   <name>Sonar :: Plugins :: Squid Java</name>
   <description>Squid analyzer for Java.</description>
 
+  <repositories>
+    <!-- for checkstyle 5.1 -->
+    <repository>
+      <id>sonar</id>
+      <name>Sonar</name>
+      <url>http://repository.sonarsource.org/content/repositories/sonar</url>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+
   <dependencies>
     <dependency>
       <groupId>org.codehaus.sonar</groupId>
 
   <build>
     <plugins>
+      <plugin>
+        <!-- TODO remove (see SONAR-2938) -->
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>enforce-no-repositories</id>
+            <configuration>
+              <skip>true</skip>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+
       <plugin>
         <groupId>org.codehaus.sonar</groupId>
         <artifactId>sonar-packaging-maven-plugin</artifactId>
diff --git a/pom.xml b/pom.xml
index 4c8b9516a83ac234a0b975ba726ca80c454278ff..432b62b4118f3121208684a23dda3ec673080575 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     </snapshotRepository>
   </distributionManagement>
 
-  <repositories>
-    <repository>
-      <!-- for checkstyle 5.1-->
-      <id>sonar</id>
-      <name>Sonar</name>
-      <url>http://repository.sonarsource.org/content/repositories/sonar</url>
-      <releases>
-        <enabled>true</enabled>
-      </releases>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-  </repositories>
-
   <properties>
     <!--
     Warning before upgrading Derby to 10.8 : new conversion from BOOLEAN to CHAR.
               </rules>
             </configuration>
           </execution>
+          <execution>
+            <id>enforce-no-repositories</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <requireNoRepositories>
+                  <!-- Also see SONAR-2849 -->
+                  <message>The rules for repo1.maven.org are that pom.xml files should not include repository definitions.</message>
+                </requireNoRepositories>
+              </rules>
+            </configuration>
+          </execution>
         </executions>
       </plugin>
       <plugin>