Skip to content

Commit

Permalink
fix: module name → com.google.errorprone.annotations
Browse files Browse the repository at this point in the history
## Summary

Fixes the module name: ~~`com.google.errorprone.annotation`~~ → `com.google.errorprone.annotations`. Amends the OSGi build not to include `Automatic-Module-Name` in the `MANIFEST.MF` for the `annotations` project.

## Changelog

- fix: name in `module-info.java` for `annotations` module
- fix: don't emit `Automatic-Module-Name` in `annotations` module
- chore: preserve all other aspects of OSGi and JAR builds

Relates to [discussion](google#4311 (comment)) in google#4311. Double checked for correct JAR structure; see [these screenshots](google#4311 (comment)).

cc / @cushon @ben-manes

Fixes google#4317

COPYBARA_INTEGRATE_REVIEW=google#4317 from sgammon:fix/module-name bc52c58
PiperOrigin-RevId: 615114274
  • Loading branch information
sgammon authored and Error Prone Team committed Mar 12, 2024
1 parent ea5ef6d commit 9d99ee7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
34 changes: 34 additions & 0 deletions annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,40 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<version>6.4.0</version>
<executions>
<execution>
<id>generate-OSGi-manifest</id>
<phase>none</phase>
</execution>
<execution>
<id>generate-OSGi-manifest-annotations</id>
<goals>
<goal>bnd-process</goal>
</goals>
<configuration>
<!--
The OSGi bundle build is overridden here to allow for MRJAR classes in the
versioned class space underneath META-INF.
The `annotations` module also should not have an `Automatic-Module-Name`.
Otherwise, these flags should stay in-sync with the same block in the root
`pom.xml`.
-->
<bnd><![CDATA[
Bundle-SymbolicName: com.google.errorprone.annotations
-exportcontents: com.google.errorprone*,!META-INF.*
-noextraheaders: true
-removeheaders: Private-Package
-fixupmessages: ^Classes found in the wrong directory: .*
]]></bnd>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
2 changes: 1 addition & 1 deletion annotations/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

open module com.google.errorprone.annotation {
open module com.google.errorprone.annotations {
requires java.compiler;

exports com.google.errorprone.annotations;
Expand Down
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,9 @@
<bnd><![CDATA[
Bundle-SymbolicName: com.google.$<replacestring;$<replacestring;${project.artifactId};^error_prone;errorprone>;_;.>
Automatic-Module-Name: $<Bundle-SymbolicName>
-exportcontents: com.google.errorprone*,!META-INF.*
-exportcontents: com.google.errorprone*
-noextraheaders: true
-removeheaders: Private-Package
-fixupmessages: ^Classes found in the wrong directory: .*
]]></bnd>
</configuration>
</execution>
Expand Down

0 comments on commit 9d99ee7

Please sign in to comment.