Skip to content

SC-51500 Skip Maven version update when pom.xml is absent - #315

Merged
hedinasr merged 2 commits into
masterfrom
fix/hnasr/SC-51500-checkPomBeforeMavenVersion
Jun 24, 2026
Merged

SC-51500 Skip Maven version update when pom.xml is absent#315
hedinasr merged 2 commits into
masterfrom
fix/hnasr/SC-51500-checkPomBeforeMavenVersion

Conversation

@hedinasr

Copy link
Copy Markdown
Contributor

Summary

  • Add a Check for pom.xml step to config-maven before the version update step
  • Only invoke set_maven_project_version.sh when pom.xml exists (or when the action is re-entered with skip=true)
  • Aligns behavior with the existing config-npm guard for package.json

Test plan

  • Run config-maven in a repo with a root pom.xml — version update should still run
  • Run config-maven in a repo without a root pom.xml — should log skip message and not fail

Add a pom.xml existence check to config-maven before invoking
set_maven_project_version.sh, mirroring the existing package.json
guard in config-npm. Repos without a root pom.xml no longer fail
during CI setup when config-maven runs.
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Jun 24, 2026

Copy link
Copy Markdown

SC-51500

@hedinasr
hedinasr marked this pull request as ready for review June 24, 2026 14:51
@hedinasr
hedinasr requested a review from a team as a code owner June 24, 2026 14:51
Copilot AI review requested due to automatic review settings June 24, 2026 14:51
Comment thread config-maven/action.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the config-maven composite action to avoid failing (or doing unnecessary work) in repositories that don’t have a pom.xml in the configured working directory, matching the existing config-npm “check manifest before version bump” behavior.

Changes:

  • Add a Check for pom.xml step that records whether pom.xml exists in inputs.working-directory.
  • Gate the Maven version update step so it only runs when pom.xml is present (or when the action is re-entered with skip=true).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Julien Carsique <julien.carsique@sonarsource.com>
@hedinasr
hedinasr enabled auto-merge (squash) June 24, 2026 14:55
@sonarqubecloud

Copy link
Copy Markdown

@hedinasr
hedinasr disabled auto-merge June 24, 2026 14:56
@hedinasr
hedinasr merged commit 71df716 into master Jun 24, 2026
17 checks passed
@hedinasr
hedinasr deleted the fix/hnasr/SC-51500-checkPomBeforeMavenVersion branch June 24, 2026 15:14
@gitar-bot

gitar-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Prevents Maven version updates in repositories lacking a pom.xml by adding an existence check before execution. No issues found.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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.

3 participants