Skip to content

Commit ee81afc

Browse files
cushongoogle-java-format Team
authored and
google-java-format Team
committed
Use Add-Exports and Add-Opens manifest entries for google-java-format
to avoid passing the flags on the command line when using `java -jar`. PiperOrigin-RevId: 432947555
1 parent ec76c66 commit ee81afc

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

pom.xml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,13 @@
198198
<!-- compile-time arguments for google-java-format -->
199199
<arg>-XDcompilePolicy=simple</arg>
200200
<arg>-Xplugin:ErrorProne</arg>
201+
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
202+
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
201203
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
202204
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
203205
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
204206
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
205207
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
206-
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
207-
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
208208
</compilerArgs>
209209
<annotationProcessorPaths>
210210
<path>
@@ -233,6 +233,19 @@
233233
<manifest>
234234
<mainClass>com.google.googlejavaformat.java.Main</mainClass>
235235
</manifest>
236+
<manifestEntries>
237+
<Add-Exports><!--
238+
-->jdk.compiler/com.sun.tools.javac.api <!--
239+
-->jdk.compiler/com.sun.tools.javac.file <!--
240+
-->jdk.compiler/com.sun.tools.javac.main <!--
241+
-->jdk.compiler/com.sun.tools.javac.model <!--
242+
-->jdk.compiler/com.sun.tools.javac.parser <!--
243+
-->jdk.compiler/com.sun.tools.javac.processing <!--
244+
-->jdk.compiler/com.sun.tools.javac.tree <!--
245+
-->jdk.compiler/com.sun.tools.javac.util<!--
246+
--></Add-Exports>
247+
<Add-Opens>jdk.compiler/com.sun.tools.javac.code jdk.compiler/com.sun.tools.javac.comp</Add-Opens>
248+
</manifestEntries>
236249
</archive>
237250
</configuration>
238251
</plugin>

0 commit comments

Comments
 (0)