Require explicit annotation dependencies 79/105379/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 11 Apr 2023 16:57:38 +0000 (18:57 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 30 May 2023 11:22:24 +0000 (13:22 +0200)
Rather than pulling in annotations at scope=provided, require them to be
explicitly declared with optional=true. Unfortunately our
dependencyManagement declaration of the optional tag is not affective
due to https://issues.apache.org/jira/browse/MNG-5227.

JIRA: ODLPARENT-300
Change-Id: I58a70840e565dbeaabf6f1398081ad176c1c0cc2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bundles-test-lib/pom.xml
docs/pom.xml
features-test/pom.xml
karaf-plugin/pom.xml
odlparent-bundle-check/pom.xml
odlparent/pom.xml
template-feature-plugin/pom.xml
tests/immutables-jpms/pom.xml

index acf7b6c2d9d488493e13b68139be45f1e526b3a0..ad2300810c039a9321a6da1a62170734cdc93d45 100644 (file)
         </exclusion>
       </exclusions>
     </dependency>
+    <dependency>
+      <groupId>org.eclipse.jdt</groupId>
+      <artifactId>org.eclipse.jdt.annotation</artifactId>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>com.github.spotbugs</groupId>
+      <artifactId>spotbugs-annotations</artifactId>
+      <optional>true</optional>
+    </dependency>
   </dependencies>
 </project>
index 51e6a3003c7ec753dd0edd4cf0d98474b77cd3a2..dbc5f51a5cf594123ebfa3841449ac272f909cf7 100644 (file)
             <artifactId>jakarta.xml.bind-api</artifactId>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.eclipse.jdt</groupId>
+            <artifactId>org.eclipse.jdt.annotation</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.github.spotbugs</groupId>
+            <artifactId>spotbugs-annotations</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
     <build>
index 95077d9c826703ee977b340a8e7bf10ee7cb8b46..353c38f54b2c7134ee4e94d40f8e7c17072cd056 100644 (file)
             <artifactId>org.osgi.framework</artifactId>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.eclipse.jdt</groupId>
+            <artifactId>org.eclipse.jdt.annotation</artifactId>
+            <optional>true</optional>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.odlparent</groupId>
             <artifactId>opendaylight-karaf-empty</artifactId>
             <artifactId>guava</artifactId>
             <scope>compile</scope>
         </dependency>
+
         <!-- The following, which are just transitive dependencies of bundles4-test,
              have to be repeated here so that the Embed-Dependency below for maven-bundle-plugin works: -->
         <dependency>
index c0d0182e231a117aa73023e098d813dbdb666b39..abf4772a40006e261c1be8c59c1eba12818a0c62 100644 (file)
       <artifactId>karaf-util</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>com.github.spotbugs</groupId>
+      <artifactId>spotbugs-annotations</artifactId>
+      <optional>true</optional>
+    </dependency>
   </dependencies>
 
   <build>
index 6be17304a4820734ce6f1264179a8c0c6435d15c..8fa29a134eb3108cd1dcd1a667d89c6fa90e33a2 100644 (file)
     <name>ODL :: odlparent :: ${project.artifactId}</name>
     <packaging>bundle</packaging>
 
+    <dependencies>
+        <dependency>
+            <groupId>org.eclipse.jdt</groupId>
+            <artifactId>org.eclipse.jdt.annotation</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>com.github.spotbugs</groupId>
+            <artifactId>spotbugs-annotations</artifactId>
+            <optional>true</optional>
+        </dependency>
+    </dependencies>
+
     <build>
         <plugins>
             <plugin>
index 93af9edf68631a9c0662920d9fd5358ace24a834..a5862f1a652a1a230d4316c8f10ea6cc7beca87d 100644 (file)
         <classifier>annotations</classifier>
         <!-- Keep this version in sync with annotationProcessorPaths declaration below -->
         <version>2.9.3</version>
-        <!-- Must be provided; scope=test here breaks APT in Eclipse :( -->
-        <scope>provided</scope>
+        <optional>true</optional>
       </dependency>
 
       <dependency>
         <groupId>com.github.spotbugs</groupId>
         <artifactId>spotbugs-annotations</artifactId>
         <version>4.7.3</version>
-        <scope>provided</scope>
         <!-- Contains retention=RUNTIME annotations, which are not really needed -->
         <optional>true</optional>
         <exclusions>
         <groupId>org.eclipse.jdt</groupId>
         <artifactId>org.eclipse.jdt.annotation</artifactId>
         <version>2.2.700</version>
-        <scope>provided</scope>
+        <optional>true</optional>
       </dependency>
       <dependency>
         <groupId>com.google.code.gson</groupId>
       <scope>provided</scope>
     </dependency>
 
-    <!--
-          Enable useful code quality annotations everywhere. Since these annotations
-          are not required at runtime.
-    -->
-    <dependency>
-      <groupId>org.eclipse.jdt</groupId>
-      <artifactId>org.eclipse.jdt.annotation</artifactId>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.github.spotbugs</groupId>
-      <artifactId>spotbugs-annotations</artifactId>
-      <scope>provided</scope>
-      <optional>true</optional>
-    </dependency>
-    <dependency>
-      <groupId>org.gaul</groupId>
-      <artifactId>modernizer-maven-annotations</artifactId>
-      <scope>provided</scope>
-    </dependency>
-
     <!--
           Testing output should be routed through slf4j-simple.
     -->
index ece026ae1ea29756f51d68afded442e6eaac263d..4128bd43fb4a5de8d5b6b6b91ceae9e1c79e3c57 100644 (file)
             <groupId>org.apache.karaf.features</groupId>
             <artifactId>org.apache.karaf.features.core</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.eclipse.jdt</groupId>
+            <artifactId>org.eclipse.jdt.annotation</artifactId>
+            <optional>true</optional>
+        </dependency>
     </dependencies>
 
     <build>
index 594e3d7535d591e9a020dfb84745025cbdb74e54..8fdd3bc41a2417f7f0554967e289a5b728b75818 100644 (file)
@@ -29,6 +29,12 @@ Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
             <groupId>org.immutables</groupId>
             <artifactId>value</artifactId>
             <classifier>annotations</classifier>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>com.github.spotbugs</groupId>
+            <artifactId>spotbugs-annotations</artifactId>
+            <optional>true</optional>
         </dependency>
     </dependencies>
 </project>