Intro. FindBugs' full :annotation (in addition to existing :jsr305) 57/47357/1
authorMichael Vorburger <vorburger@redhat.com>
Fri, 21 Oct 2016 17:47:18 +0000 (19:47 +0200)
committerMichael Vorburger <vorburger@redhat.com>
Fri, 21 Oct 2016 17:47:18 +0000 (19:47 +0200)
Having both of these is a required intermediate step, in order to switch
completely over to :annotation instead of :jsr305, which would be
preferable, because these two JARs define the same annotations and
overlap, which is never great.

This change will allow all downstream projects to gradually switch their
<dependency><groupId>com.google.code.findbugs from <artifactId>jsr305 to
<artifactId>annotations in all pom.xml. They will NOT have to adapt any
code, because the actual Java types are exactly the same (just from a
different Maven artefact).

When all downstream projects have switched over, then we'll replace what
this change added by the cleaner "real" solution prepared in
https://git.opendaylight.org/gerrit/#/c/47337/

see also discussion in https://git.opendaylight.org/gerrit/#/c/46914/

Change-Id: Ib026cd0338b263bb9663f2d1fa2a6cb167d6f136
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
odlparent/pom.xml

index cf5560a2d3b2e6bb9422ee0dde81ce21af7c35f5..ac294d6d6e47f4bb4e719fc6f1961681e741c41d 100644 (file)
         <artifactId>jsr305</artifactId>
         <version>3.0.0</version>
       </dependency>
+      <dependency>
+        <groupId>com.google.code.findbugs</groupId>
+        <artifactId>annotations</artifactId>
+        <version>3.0.0</version>
+        <exclusions>
+          <!-- We'd like (have) to eventually exclude :jsr305 here as well, because
+               the types of this artifact are already shaded inside the :annotations artifact.
+               This state is a temporary solution to allow all projects to gradually switch over
+               switch their <dependency><groupId>com.google.code.findbugs from
+               <artifactId>jsr305 to <artifactId>annotations in all pom.xml.
+               The target solution is https://git.opendaylight.org/gerrit/#/c/47337/
+            -->
+          <exclusion>
+            <groupId>net.jcip</groupId>
+            <!-- The types of this artifact are already shaded inside the :annotations artifact -->
+            <artifactId>jcip-annotations</artifactId>
+          </exclusion>
+        </exclusions>
+      </dependency>
       <dependency>
         <groupId>com.google.code.gson</groupId>
         <artifactId>gson</artifactId>
     </dependency>
 
     <!-- Enable JSR-305 annotations everywhere -->
+    <dependency>
+      <groupId>com.google.code.findbugs</groupId>
+      <artifactId>annotations</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <!-- See note above; having both :jsr305 and :annotations here is an intermediate step -->
     <dependency>
       <groupId>com.google.code.findbugs</groupId>
       <artifactId>jsr305</artifactId>