From 7f38e5c1ed13ef25c09335f82928e2e6f2af08ac Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Fri, 12 May 2023 18:41:13 -0700 Subject: [PATCH] Add OSGi runtime metadata to error-prone's MANIFEST.MF files As suggested in https://github.com/google/error-prone/issues/2967#issuecomment-1535520417 this PR aims to add OSGi runtime metadata to the error-prone jars. It achieves this by employing the [bnd-maven-plugin:bnd-process](https://github.com/bndtools/bnd/tree/master/maven-plugins/bnd-maven-plugin#bnd-process-goal) goal to generate the OSGi metadata, like the values of the Manifest headers `Bundle-SymbolicName`, `Import-Package` and `Export-Package`. The schema used for `Bundle-SymbolicName` headers is based on the schema used for the `Automatic-Module-Name` in the error-prone-annotations artifact. With this change additionally all other error-prone artifacts get a `Automatic-Module-Name` too. @cushon can you please review this PR? If you have any question, I would be happy to answer them. Fixes https://github.com/google/error-prone/issues/2967 Fixes #3903 FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/google/error-prone/pull/3903 from HannesWell:osgiMetadata f1ee0a47b24c99eb128c9652a5ff53d70e6f48de PiperOrigin-RevId: 531653111 --- annotations/pom.xml | 10 ---------- pom.xml | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/annotations/pom.xml b/annotations/pom.xml index c23065c1af3c..03c522c03911 100644 --- a/annotations/pom.xml +++ b/annotations/pom.xml @@ -54,16 +54,6 @@ - - maven-jar-plugin - - - - com.google.errorprone.annotations - - - - diff --git a/pom.xml b/pom.xml index 01bfcaf1f649..619b27e4d49e 100644 --- a/pom.xml +++ b/pom.xml @@ -136,10 +136,37 @@ + + biz.aQute.bnd + bnd-maven-plugin + 6.4.0 + + + generate-OSGi-manifest + + bnd-process + + + ;_;.> + Automatic-Module-Name: $ + -exportcontents: com.google.errorprone* + -noextraheaders: true + -removeheaders: Private-Package + ]]> + + + + org.apache.maven.plugins maven-jar-plugin 3.2.2 + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + org.apache.maven.plugins