Skip to content

MOSIP-37901 - Exclude MOSIP services from being published or released…#302

Open
NidhiKumari0201 wants to merge 1 commit into
mosip:release-1.3.xfrom
NidhiKumari0201:MOSIP-37901-release-1.3x-nexus
Open

MOSIP-37901 - Exclude MOSIP services from being published or released…#302
NidhiKumari0201 wants to merge 1 commit into
mosip:release-1.3.xfrom
NidhiKumari0201:MOSIP-37901-release-1.3x-nexus

Conversation

@NidhiKumari0201
Copy link
Copy Markdown
Contributor

@NidhiKumari0201 NidhiKumari0201 commented Apr 27, 2026

… to nexus

Summary by CodeRabbit

  • Chores
    • Updated Maven build configuration for publishing process. No user-facing changes.

… to nexus

Signed-off-by: Nidhi0201 <nidhi.k@cyberpwn.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

Walkthrough

This pull request adds new execution configurations for the central-publishing-maven-plugin in two Maven POM files. Each execution defines a default-publish goal bound to the none phase, preventing automatic publication during standard build lifecycle phases while maintaining existing plugin settings.

Changes

Cohort / File(s) Summary
Central Publishing Plugin Execution
commons-packet/pom.xml, commons-packet/commons-packet-service/pom.xml
Adds default-publish execution to central-publishing-maven-plugin with publish goal bound to none phase, allowing manual triggering while preserving existing autoPublish=false configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A publication awaits,
No auto-run through the gates,
Maven plugins now aligned,
Two configs of matching kind,
Release when the time is right! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly relates to the main change: configuring Maven plugin executions to exclude MOSIP services from publishing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
commons-packet/pom.xml (1)

39-53: ⚠️ Potential issue | 🟠 Major

commons-packet-manager actively deploys via maven-deploy-plugin and central-publishing-maven-plugin — both need disabling.

The aggregator POM lacks maven-deploy-plugin skip configuration, and the child module commons-packet-manager is actively configured to deploy:

  1. Aggregator (commons-packet/pom.xml) needs maven-deploy-plugin skip. Running mvn deploy will attempt to push this aggregator artifact to https://central.sonatype.com/api/v1/publisher via the distributionManagement block (lines 44–53).

  2. commons-packet-manager produces a deployable artifact without publish restrictions. Its maven-deploy-plugin is set to <phase>deploy</phase>, meaning mvn deploy will execute. The central-publishing-maven-plugin is only set to <autoPublish>false</autoPublish>, which prevents auto-publishing but does not block the deploy goal entirely. To match the stated objective, add <skip>true</skip> and override default-deploy to phase=none in commons-packet-manager/pom.xml as well.

  3. Remove <distributionManagement> blocks from both POMs since they point to Sonatype Central and contradict the goal of excluding these MOSIP services from publication. Alternatively, move the skip configuration into parent pluginManagement so all modules inherit it.

Suggested addition for aggregator POM
             <plugins>
                 <plugin>
                     <groupId>org.springframework.boot</groupId>
                     <artifactId>spring-boot-maven-plugin</artifactId>
                     <version>3.2.3</version>
                 </plugin>
+                <plugin>
+                    <artifactId>maven-deploy-plugin</artifactId>
+                    <version>${maven.deploy.plugin.version}</version>
+                    <configuration>
+                        <skip>true</skip>
+                    </configuration>
+                    <executions>
+                        <execution>
+                            <id>default-deploy</id>
+                            <phase>none</phase>
+                            <goals>
+                                <goal>deploy</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@commons-packet/pom.xml` around lines 39 - 53, Add configuration to prevent
accidental publishing: in the aggregator POM (commons-packet/pom.xml) disable
the maven-deploy-plugin by setting its skip to true (or override the
default-deploy execution to phase=none) so the aggregator won’t run deploy on
mvn deploy, and remove or relocate the distributionManagement block that points
to Sonatype; in the commons-packet-manager child POM disable its
maven-deploy-plugin by adding <skip>true</skip> and override the default-deploy
execution to phase=none (or inherit the skip via parent pluginManagement), and
ensure central-publishing-maven-plugin remains with autoPublish false (or is
removed) so no module runs the deploy goal or publishes to the Sonatype
repository.
♻️ Duplicate comments (1)
commons-packet/pom.xml (1)

155-163: 🧹 Nitpick | 🔵 Trivial

Same caveat as in the service POM: verify the auto-injected execution id and consider skipPublishing.

Identical change as in commons-packet/commons-packet-service/pom.xml — the override depends on the plugin's lifecycle-injected execution being named default-publish, which is Maven convention but not guaranteed for an extension-injected goal. Prefer the plugin's documented <skipPublishing>true</skipPublishing> configuration (or drop <extensions>true</extensions>) to make intent explicit and not rely on internal id naming.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@commons-packet/pom.xml` around lines 155 - 163, The POM currently disables
the auto-injected publish execution by referencing an assumed execution id
"default-publish" and setting its phase to "none"; instead, update the plugin
configuration for the publish goal used in this module (the execution with id
"default-publish" / goal "publish") to explicitly use the plugin-supported flag
(e.g., add <skipPublishing>true</skipPublishing>) or remove/avoid
<extensions>true</extensions> so you don't rely on an implementation-specific
execution id, ensuring the publish behavior is disabled via the plugin's
documented configuration rather than by overriding a possibly non‑existent
execution id.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@commons-packet/commons-packet-service/pom.xml`:
- Around line 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.

---

Outside diff comments:
In `@commons-packet/pom.xml`:
- Around line 39-53: Add configuration to prevent accidental publishing: in the
aggregator POM (commons-packet/pom.xml) disable the maven-deploy-plugin by
setting its skip to true (or override the default-deploy execution to
phase=none) so the aggregator won’t run deploy on mvn deploy, and remove or
relocate the distributionManagement block that points to Sonatype; in the
commons-packet-manager child POM disable its maven-deploy-plugin by adding
<skip>true</skip> and override the default-deploy execution to phase=none (or
inherit the skip via parent pluginManagement), and ensure
central-publishing-maven-plugin remains with autoPublish false (or is removed)
so no module runs the deploy goal or publishes to the Sonatype repository.

---

Duplicate comments:
In `@commons-packet/pom.xml`:
- Around line 155-163: The POM currently disables the auto-injected publish
execution by referencing an assumed execution id "default-publish" and setting
its phase to "none"; instead, update the plugin configuration for the publish
goal used in this module (the execution with id "default-publish" / goal
"publish") to explicitly use the plugin-supported flag (e.g., add
<skipPublishing>true</skipPublishing>) or remove/avoid
<extensions>true</extensions> so you don't rely on an implementation-specific
execution id, ensuring the publish behavior is disabled via the plugin's
documented configuration rather than by overriding a possibly non‑existent
execution id.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cdc5f7ed-6712-41ee-aa6d-da6b379ec4c3

📥 Commits

Reviewing files that changed from the base of the PR and between 4780be0 and f3786ce.

📒 Files selected for processing (2)
  • commons-packet/commons-packet-service/pom.xml
  • commons-packet/pom.xml

Comment on lines +184 to +192
<executions>
<execution>
<id>default-publish</id>
<phase>none</phase>
<goals>
<goal>publish</goal>
</goals>
</execution>
</executions>
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant