]> git.basschouten.com Git - openhab-addons.git/commitdiff
Suppress bnd warnings for unused imports/exports (#11513)
authorWouter Born <github@maindrain.net>
Fri, 5 Nov 2021 12:56:58 +0000 (13:56 +0100)
committerGitHub <noreply@github.com>
Fri, 5 Nov 2021 12:56:58 +0000 (13:56 +0100)
Ignores warnings like:

```
Warning:  /home/runner/work/openhab-addons/openhab-addons/bom/runtime-index/pom.xml [0:0]: Unused Export-Package instructions: [org.openhab.*]
Warning:  /home/runner/work/openhab-addons/openhab-addons/bom/runtime-index/pom.xml [0:0]: Unused Import-Package instructions: [io.swagger.v3.oas.annotations.*,
```

These are safe to ignore because the import/export packages are globally defined and not every bundle imports/exports all these packages.

The `skipIfEmpty` configuration furthermore prevents warnings when the bnd-maven-plugin runs on projects that don't have any code like BOMs.

More important compiler/SAT warnings standout more when there are there are fewer useless warnings.

Signed-off-by: Wouter Born <github@maindrain.net>
pom.xml

diff --git a/pom.xml b/pom.xml
index ba3b31ff637cf8dc442e07670233ffdd0630c7f3..a25687bcdb1fbd12684100183e475fa9c2f95edc 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -159,9 +159,13 @@ Import-Package: \\
 -sources: false
 -contract: *
 -includeresource: ${bnd.includeresource}
--fixupmessages: ${bnd.fixupmessages}]]></bnd>
+-fixupmessages: \\
+  'Unused Import-Package instructions';is:=ignore,\\
+  'Unused Export-Package instructions';is:=ignore,\\
+  ${bnd.fixupmessages}]]></bnd>
             <!-- -dsannotations-options: norequirements -->
             <!-- Bundle-SymbolicName: ${project.groupId}.${project.artifactId} -->
+            <skipIfEmpty>true</skipIfEmpty>
           </configuration>
           <executions>
             <execution>