Removing the directory META-INF/maven from all .jar files reduces the size of generated files. I tried running these stripped .jar files for some time and could not see run-time downsides.
It can be tried on an installed system with openHAB 5.2.1
Before
$ du -sc --apparent-size $(find /usr/share/openhab/runtime/system/org/openhab -name '*.jar')
…
29364 total (28.67 MB)
Strip META-INF/maven from all org/openhab .jar files
Stop openHAB, clean the cache and then:
$ for i in $(find /usr/share/openhab/runtime/system/org/openhab -name '*.jar'); do \
zip $i -d "META-INF/maven/*"; \
chown openhab:openhab $i; \
done
After
$ du -sc --apparent-size $(find /usr/share/openhab/runtime/system/org/openhab -name '*.jar')
…
29141 total (28.46 MB)
Adjusting the build process to avoid adding META-INF/maven/
--- a/bundles/pom.xml
+++ b/bundles/pom.xml
@@ -145,6 +145,7 @@
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+ <addMavenDescriptor>false</addMavenDescriptor>
</archive>
<skipIfEmpty>true</skipIfEmpty>
</configuration>
That’s it!