Make annotations optional 75/76775/3
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 8 Oct 2018 23:44:14 +0000 (01:44 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 9 Oct 2018 01:06:44 +0000 (03:06 +0200)
JSR-305 annotations are strictly optional to resolve, as they do not
affection production funcionality. Make sure we mark them as such,
which prevents downstreams failing with newer JDK.

Change-Id: I869e0c84f9762e2abfb10b994890fe98cdb850ce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
features/odl-bundle-test/pom.xml [new file with mode: 0644]
features/pom.xml
odlparent-bundle-check/pom.xml [new file with mode: 0644]
odlparent-bundle-check/src/main/java/org/opendaylight/odlparent/bundle/JDTAnnotations.java [new file with mode: 0644]
odlparent-bundle-check/src/main/java/org/opendaylight/odlparent/bundle/JavaxAnnotations.java [new file with mode: 0644]
odlparent/pom.xml
pom.xml

diff --git a/features/odl-bundle-test/pom.xml b/features/odl-bundle-test/pom.xml
new file mode 100644 (file)
index 0000000..44a21a3
--- /dev/null
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright © 2018 Pantheon Technologies, s.r.o.. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+ -->
+<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.opendaylight.odlparent</groupId>
+        <artifactId>single-feature-parent</artifactId>
+        <version>4.0.3-SNAPSHOT</version>
+        <relativePath>../../single-feature-parent</relativePath>
+    </parent>
+
+    <artifactId>odl-bundle-test</artifactId>
+    <name>ODL :: odlparent :: ${project.artifactId}</name>
+    <packaging>kar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.odlparent</groupId>
+            <artifactId>odlparent-bundle-check</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-install-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
index efa97d286514c29fe7270bf7dbb5af585443ca6b..51070c6da88b8ce17fb16ce9af512672d2865589 100644 (file)
@@ -61,5 +61,6 @@
         <module>odl-netty-4</module>
 
         <!-- Test features -->
+        <module>odl-bundle-test</module>
     </modules>
 </project>
diff --git a/odlparent-bundle-check/pom.xml b/odlparent-bundle-check/pom.xml
new file mode 100644 (file)
index 0000000..9634919
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright © 2018 Pantheon Technologies, s.r.o. and others.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<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.opendaylight.odlparent</groupId>
+        <artifactId>bundle-parent</artifactId>
+        <version>4.0.3-SNAPSHOT</version>
+        <relativePath>../bundle-parent</relativePath>
+    </parent>
+
+    <groupId>org.opendaylight.odlparent</groupId>
+    <artifactId>odlparent-bundle-check</artifactId>
+    <version>4.0.3-SNAPSHOT</version>
+    <name>ODL :: odlparent :: ${project.artifactId}</name>
+    <packaging>bundle</packaging>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/odlparent-bundle-check/src/main/java/org/opendaylight/odlparent/bundle/JDTAnnotations.java b/odlparent-bundle-check/src/main/java/org/opendaylight/odlparent/bundle/JDTAnnotations.java
new file mode 100644 (file)
index 0000000..5635cb7
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.odlparent.bundle;
+
+import org.eclipse.jdt.annotation.NonNull;
+
+public interface JDTAnnotations {
+
+    @NonNull Object nonNullMethodReturn();
+}
diff --git a/odlparent-bundle-check/src/main/java/org/opendaylight/odlparent/bundle/JavaxAnnotations.java b/odlparent-bundle-check/src/main/java/org/opendaylight/odlparent/bundle/JavaxAnnotations.java
new file mode 100644 (file)
index 0000000..c81e953
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.odlparent.bundle;
+
+import javax.annotation.Nonnull;
+
+public interface JavaxAnnotations {
+
+    @Nonnull Object nonNullMethodReturn();
+}
index 5b6ba7298ba3fb5ea84844cd3c849fe0397fc55b..1db8e3f7e8e7410f0c0eb29739a889f1787ee7c1 100644 (file)
       <groupId>com.google.code.findbugs</groupId>
       <artifactId>annotations</artifactId>
       <scope>provided</scope>
+      <!-- Contains retention=RUNTIME annotations, which are not really needed -->
+      <optional>true</optional>
     </dependency>
     <dependency>
       <groupId>org.eclipse.jdt</groupId>
diff --git a/pom.xml b/pom.xml
index 0f1279989e1747183ebfe0ead42509f35a4fde94..55927e310e19270facc5ec352b6b1fb042afbdf2 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -63,6 +63,7 @@
         <module>odlparent-artifacts</module>
 
         <!-- Self-tests -->
+        <module>odlparent-bundle-check</module>
         <module>odlparent-dependency-check</module>
     </modules>