You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by pk...@apache.org on 2026/06/20 20:09:37 UTC
(commons-xml) 42/50: Fix release artifacts for Maven Central (#17)
This is an automated email from the ASF dual-hosted git repository.
ppkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/commons-xml.git
commit bc66dc21c7b297ca1c0496bba954c94dd30b2e62
Author: Piotr P. Karwasz <pk...@apache.org>
AuthorDate: Wed Jun 10 10:52:29 2026 +0200
Fix release artifacts for Maven Central (#17)
The 0.1.0 deployment was rejected because the bundle carried no GPG
signatures, no Javadoc jar, and no CycloneDX BOM, while publishing
test-jar and test-sources artifacts that consumers do not need.
This change sets cyclonedx.skipNotDeployed to false so the BOM is built
even though central-publishing replaces the stock deploy goal, and drops
the inherited test-jar and test-sources executions while keeping the
Central-required main sources jar. Signing and the Javadoc jar already
come from the release profile at deploy time.
Assisted-By: Claude Opus 4.8 (1M context) <no...@anthropic.com>
---
pom.xml | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/pom.xml b/pom.xml
index f0121ab..65b1f72 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,6 +104,8 @@
<!-- Sonatype Central Publishing -->
<central.publishing.version>0.10.0</central.publishing.version>
+ <!-- We use Central and the `deploy` goal auto-detection does not currently work with it -->
+ <cyclonedx.skipNotDeployed>false</cyclonedx.skipNotDeployed>
<!-- Flatten Maven plugin: produces a consumer POM at deploy time. -->
<flatten-maven-plugin.version>1.7.3</flatten-maven-plugin.version>
@@ -298,6 +300,41 @@
</executions>
</plugin>
+ <!-- Do not publish a test-jar: the test classes are not part of the consumer contract. -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!--
+ commons-parent's create-source-jar execution attaches both the main sources (jar-no-fork) and the test
+ sources (test-jar-no-fork) in one execution. Disable it and re-bind a main-sources-only execution, so the
+ published artifact keeps the Central-required sources jar but drops the test-sources jar.
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>create-source-jar</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>create-main-source-jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
<!-- Publish to the new Sonatype Central API. -->
<plugin>
<groupId>org.sonatype.central</groupId>