Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions commons-packet/commons-packet-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,15 @@
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central.publishing.maven.plugin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>default-publish</id>
<phase>none</phase>
<goals>
<goal>publish</goal>
</goals>
</execution>
</executions>
Comment on lines +184 to +192
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Verify default-publish is the actual auto-injected execution id, and consider the documented skipPublishing alternative.

central-publishing-maven-plugin uses <extensions>true</extensions> and registers as a Maven lifecycle participant that dynamically injects its publish goal into the deploy phase. Overriding it with an execution id of default-publish and <phase>none</phase> relies on Maven's default-<goalId> naming convention for that injection. With this plugin that convention is not officially documented for the injected execution — if the plugin uses any other id, this override will silently do nothing and the goal will still run on mvn deploy.

A cleaner, documented alternative is the plugin's own configuration switch <skipPublishing>true</skipPublishing> (intended for "creating only the bundle but skipping uploading and publishing"). Even simpler, since the PR's stated goal is to exclude these services from Nexus/Central entirely, you could drop <extensions>true</extensions> (or remove the plugin block) so the plugin no longer auto-binds to the lifecycle at all.

This block is duplicated verbatim in commons-packet/pom.xml — please keep them in sync (or define it once in the aggregator and inherit, which is currently not possible since this POM does not declare a <parent>).

♻️ Documented alternative using skipPublishing
     <plugin>
         <groupId>org.sonatype.central</groupId>
         <artifactId>central-publishing-maven-plugin</artifactId>
         <version>${central.publishing.maven.plugin.version}</version>
         <extensions>true</extensions>
-        <executions>
-            <execution>
-                <id>default-publish</id>
-                <phase>none</phase>
-                <goals>
-                    <goal>publish</goal>
-                </goals>
-            </execution>
-        </executions>
         <configuration>
             <publishingServerId>ossrh</publishingServerId>
             <autoPublish>false</autoPublish>
+            <skipPublishing>true</skipPublishing>
         </configuration>
     </plugin>

Please run a quick mvn -X deploy -DskipTests (or just mvn -X help:describe -Dplugin=org.sonatype.central:central-publishing-maven-plugin -Ddetail=true) and confirm that the execution id Maven prints for the auto-injected publish goal is indeed default-publish — that is the linchpin assumption of this change.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<executions>
<execution>
<id>default-publish</id>
<phase>none</phase>
<goals>
<goal>publish</goal>
</goals>
</execution>
</executions>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central.publishing.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>ossrh</publishingServerId>
<autoPublish>false</autoPublish>
<skipPublishing>true</skipPublishing>
</configuration>
</plugin>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@commons-packet/commons-packet-service/pom.xml` around lines 184 - 192, The
current execution override for the central-publishing-maven-plugin uses an
execution id of default-publish with <phase>none</phase> which may not match the
plugin's auto-injected execution id; verify the actual injected id by running
mvn -X help:describe
-Dplugin=org.sonatype.central:central-publishing-maven-plugin -Ddetail=true (or
mvn -X deploy -DskipTests) and if the id differs, either remove this execution
override and instead set the plugin config property
<skipPublishing>true</skipPublishing> inside the central-publishing-maven-plugin
configuration (or drop <extensions>true</extensions> entirely to avoid
auto-binding), and make the same change in the duplicated block in
commons-packet/pom.xml so both POMs stay in sync.

<configuration>
<publishingServerId>ossrh</publishingServerId>
<autoPublish>false</autoPublish>
Expand Down
9 changes: 9 additions & 0 deletions commons-packet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central.publishing.maven.plugin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>default-publish</id>
<phase>none</phase>
<goals>
<goal>publish</goal>
</goals>
</execution>
</executions>
<configuration>
<publishingServerId>ossrh</publishingServerId>
<autoPublish>false</autoPublish>
Expand Down
Loading