Skip to content

Commit e3096f2

Browse files
dfa1claude
andcommitted
fix: make Maven Central publishing pass validation
The central-publishing-maven-plugin does not honor maven.deploy.skip, so the benchmark and integration-tests modules were bundled into the Central deployment without javadoc jars and rejected. Exclude them via the plugin's excludeArtifacts. The six resource-only zstd-native-* jars carry no Java sources, so Central likewise rejected them for missing javadoc/sources. Skip the real javadoc/source plugins there and attach empty stub jars via maven-jar-plugin. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b244c83 commit e3096f2

7 files changed

Lines changed: 112 additions & 0 deletions

File tree

native/linux-aarch64/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
<description>Native zstd library for Linux aarch64</description>
1515
<packaging>jar</packaging>
1616

17+
<properties>
18+
<!-- No Java to document or attach; the parent's maven-jar-plugin
19+
attaches empty javadoc/sources jars for Maven Central instead. -->
20+
<maven.javadoc.skip>true</maven.javadoc.skip>
21+
<maven.source.skip>true</maven.source.skip>
22+
</properties>
23+
1724
<!-- No Java sources: this module only packages the native shared library. -->
1825
<build>
1926
<plugins>
@@ -37,6 +44,10 @@
3744
</execution>
3845
</executions>
3946
</plugin>
47+
<plugin>
48+
<groupId>org.apache.maven.plugins</groupId>
49+
<artifactId>maven-jar-plugin</artifactId>
50+
</plugin>
4051
</plugins>
4152
</build>
4253
</project>

native/linux-x86_64/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
<description>Native zstd library for Linux x86_64</description>
1515
<packaging>jar</packaging>
1616

17+
<properties>
18+
<!-- No Java to document or attach; the parent's maven-jar-plugin
19+
attaches empty javadoc/sources jars for Maven Central instead. -->
20+
<maven.javadoc.skip>true</maven.javadoc.skip>
21+
<maven.source.skip>true</maven.source.skip>
22+
</properties>
23+
1724
<!-- No Java sources: this module only packages the native shared library. -->
1825
<build>
1926
<plugins>
@@ -37,6 +44,10 @@
3744
</execution>
3845
</executions>
3946
</plugin>
47+
<plugin>
48+
<groupId>org.apache.maven.plugins</groupId>
49+
<artifactId>maven-jar-plugin</artifactId>
50+
</plugin>
4051
</plugins>
4152
</build>
4253
</project>

native/osx-aarch64/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
<description>Native zstd library for macOS aarch64</description>
1515
<packaging>jar</packaging>
1616

17+
<properties>
18+
<!-- No Java to document or attach; the parent's maven-jar-plugin
19+
attaches empty javadoc/sources jars for Maven Central instead. -->
20+
<maven.javadoc.skip>true</maven.javadoc.skip>
21+
<maven.source.skip>true</maven.source.skip>
22+
</properties>
23+
1724
<!-- No Java sources: this module only packages the native shared library. -->
1825
<build>
1926
<plugins>
@@ -37,6 +44,10 @@
3744
</execution>
3845
</executions>
3946
</plugin>
47+
<plugin>
48+
<groupId>org.apache.maven.plugins</groupId>
49+
<artifactId>maven-jar-plugin</artifactId>
50+
</plugin>
4051
</plugins>
4152
</build>
4253
</project>

native/osx-x86_64/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
<description>Native zstd library for macOS x86_64</description>
1515
<packaging>jar</packaging>
1616

17+
<properties>
18+
<!-- No Java to document or attach; the parent's maven-jar-plugin
19+
attaches empty javadoc/sources jars for Maven Central instead. -->
20+
<maven.javadoc.skip>true</maven.javadoc.skip>
21+
<maven.source.skip>true</maven.source.skip>
22+
</properties>
23+
1724
<!-- No Java sources: this module only packages the native shared library. -->
1825
<build>
1926
<plugins>
@@ -37,6 +44,10 @@
3744
</execution>
3845
</executions>
3946
</plugin>
47+
<plugin>
48+
<groupId>org.apache.maven.plugins</groupId>
49+
<artifactId>maven-jar-plugin</artifactId>
50+
</plugin>
4051
</plugins>
4152
</build>
4253
</project>

native/windows-aarch64/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
<description>Native zstd library for Windows aarch64</description>
1515
<packaging>jar</packaging>
1616

17+
<properties>
18+
<!-- No Java to document or attach; the parent's maven-jar-plugin
19+
attaches empty javadoc/sources jars for Maven Central instead. -->
20+
<maven.javadoc.skip>true</maven.javadoc.skip>
21+
<maven.source.skip>true</maven.source.skip>
22+
</properties>
23+
1724
<!-- No Java sources: this module only packages the native shared library. -->
1825
<build>
1926
<plugins>
@@ -37,6 +44,10 @@
3744
</execution>
3845
</executions>
3946
</plugin>
47+
<plugin>
48+
<groupId>org.apache.maven.plugins</groupId>
49+
<artifactId>maven-jar-plugin</artifactId>
50+
</plugin>
4051
</plugins>
4152
</build>
4253
</project>

native/windows-x86_64/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
<description>Native zstd library for Windows x86_64</description>
1515
<packaging>jar</packaging>
1616

17+
<properties>
18+
<!-- No Java to document or attach; the parent's maven-jar-plugin
19+
attaches empty javadoc/sources jars for Maven Central instead. -->
20+
<maven.javadoc.skip>true</maven.javadoc.skip>
21+
<maven.source.skip>true</maven.source.skip>
22+
</properties>
23+
1724
<!-- No Java sources: this module only packages the native shared library. -->
1825
<build>
1926
<plugins>
@@ -37,6 +44,10 @@
3744
</execution>
3845
</executions>
3946
</plugin>
47+
<plugin>
48+
<groupId>org.apache.maven.plugins</groupId>
49+
<artifactId>maven-jar-plugin</artifactId>
50+
</plugin>
4051
</plugins>
4152
</build>
4253
</project>

pom.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
<maven-source-plugin.version>3.4.0</maven-source-plugin.version>
5656
<maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
5757
<maven-release-plugin.version>3.3.1</maven-release-plugin.version>
58+
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
5859
</properties>
5960

6061
<dependencyManagement>
@@ -191,6 +192,40 @@
191192
<localCheckout>true</localCheckout>
192193
</configuration>
193194
</plugin>
195+
<plugin>
196+
<groupId>org.apache.maven.plugins</groupId>
197+
<artifactId>maven-jar-plugin</artifactId>
198+
<version>${maven-jar-plugin.version}</version>
199+
<executions>
200+
<!-- Resource-only native modules carry no Java sources. Attach
201+
empty javadoc/sources jars (from non-existent dirs) so Maven
202+
Central's "javadoc + sources required" validation passes. -->
203+
<execution>
204+
<id>empty-javadoc-jar</id>
205+
<phase>package</phase>
206+
<goals>
207+
<goal>jar</goal>
208+
</goals>
209+
<configuration>
210+
<classifier>javadoc</classifier>
211+
<classesDirectory>${project.build.directory}/empty-javadoc</classesDirectory>
212+
<forceCreation>true</forceCreation>
213+
</configuration>
214+
</execution>
215+
<execution>
216+
<id>empty-sources-jar</id>
217+
<phase>package</phase>
218+
<goals>
219+
<goal>jar</goal>
220+
</goals>
221+
<configuration>
222+
<classifier>sources</classifier>
223+
<classesDirectory>${project.build.directory}/empty-sources</classesDirectory>
224+
<forceCreation>true</forceCreation>
225+
</configuration>
226+
</execution>
227+
</executions>
228+
</plugin>
194229
</plugins>
195230
</pluginManagement>
196231
<plugins>
@@ -289,6 +324,17 @@
289324
<publishingServerId>central</publishingServerId>
290325
<autoPublish>true</autoPublish>
291326
<waitUntil>published</waitUntil>
327+
<excludeArtifacts>
328+
<!-- Internal modules: not published to Maven Central. -->
329+
<artifact>
330+
<groupId>io.github.dfa1.zstd</groupId>
331+
<artifactId>zstd-integration-tests</artifactId>
332+
</artifact>
333+
<artifact>
334+
<groupId>io.github.dfa1.zstd</groupId>
335+
<artifactId>zstd-benchmark</artifactId>
336+
</artifact>
337+
</excludeArtifacts>
292338
</configuration>
293339
</plugin>
294340
</plugins>

0 commit comments

Comments
 (0)