Skip to content

Commit bcbb3f3

Browse files
committed
Configure maven-jar-plugin to skip jar artifact generation when no files are present
The root issue occurs when building a POM-packaged parent project. Without explicitly skipping JAR generation for an empty content the maven-jar-plugin creates an empty JAR artifact. During installation, Maven incorrectly maps this JAR to the POM file location. This results in binary JAR data being written to pom. Subsequent builds fail with FATAL error since Maven expects valid XML but finds binary data. First reproduced while building pdfocr on macOS 15.5 (aarch64) with Maven 3.9.8.
1 parent dbcad03 commit bcbb3f3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@
252252
<plugin>
253253
<artifactId>maven-jar-plugin</artifactId>
254254
<version>${maven.jar.version}</version>
255+
<configuration>
256+
<skipIfEmpty>true</skipIfEmpty>
257+
</configuration>
255258
</plugin>
256259
<plugin>
257260
<artifactId>maven-javadoc-plugin</artifactId>

0 commit comments

Comments
 (0)