diff --git a/gson/bnd.bnd b/gson/bnd.bnd
index 07746f0a48..5237831fc8 100644
--- a/gson/bnd.bnd
+++ b/gson/bnd.bnd
@@ -17,3 +17,9 @@ Import-Package: sun.misc;resolution:=optional, *
com.google.gson.annotations,\
com.google.gson.reflect,\
com.google.gson.stream
+
+# Ignore error about module-info.class being in wrong directory
+# See related https://issues.apache.org/jira/browse/FELIX-5592 (but that is for different plugin)
+# and https://github.com/bndtools/bnd/issues/2227
+-fixupmessages:\
+ "Classes found in the wrong directory: \\{META-INF/versions/9/module-info\\.class=module-info\\}";is:=warning
diff --git a/gson/pom.xml b/gson/pom.xml
index d9d37baa33..0671c5b79f 100644
--- a/gson/pom.xml
+++ b/gson/pom.xml
@@ -59,6 +59,7 @@
maven-jar-plugin
+
${project.build.outputDirectory}/META-INF/MANIFEST.MF
diff --git a/pom.xml b/pom.xml
index d0d45be9a1..c9e6294ba0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
UTF-8
- 1.6
+ 1.6
@@ -70,30 +70,32 @@
default-compile
- 9
+ [1.5,9)
- 9
+
+ ${javaVersion}
+
+ module-info.java
+
- base-compile
+ java-9-compile
compile
-
- module-info.java
-
+
+ 9
+
+ 9
+
+ module-info.java
+
+ true
-
-
- [1.5,9)
-
-
- 1.6
-
org.apache.maven.plugins
@@ -104,12 +106,15 @@
org.apache.maven.plugins
maven-jar-plugin
3.2.0
-
-
- org.apache.felix
- maven-bundle-plugin
- 5.1.2
- true
+
+
+
+
+ true
+
+
+