Skip to content

PREQ-7452 Maven build: normalize Windows backslash paths when pushing artifacts - #326

Merged
tomverin merged 3 commits into
masterfrom
fix/build-maven-windows-installed-artifacts-path
Jul 21, 2026
Merged

PREQ-7452 Maven build: normalize Windows backslash paths when pushing artifacts#326
tomverin merged 3 commits into
masterfrom
fix/build-maven-windows-installed-artifacts-path

Conversation

@mary-georgiou

@mary-georgiou mary-georgiou commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Updated the paths to count also for windows path seperators.


Summary by Gitar

  • Build improvements:
    • Normalized Windows-style backslash paths in build-maven/build.sh to ensure consistent artifact path formatting.
    • Updated grep and sed patterns to handle both / and \ separators for local repository paths.
  • Dependency management:
    • Fixed jf config edit in build-maven/deploy-artifacts.sh by adding the --url parameter to prevent field clearing issues.
  • Testing:
    • Added regression tests in spec/build-maven_spec.sh to verify path normalization with Windows-style Installing log entries.
    • Updated spec/build-maven_deploy-artifacts_spec.sh to reflect the updated jf config edit command.

This will update automatically on new commits.

…acts

On Windows runners, Maven's install plugin logs local-repo paths with
backslashes (C:\...\.m2\repository\...), but the sed extracting the
relative artifact path only matched a forward-slash .m2/repository/
prefix. The unmodified line was then passed to deploy-artifacts.sh,
where unquoted word-splitting broke it into unrecognized tokens and
every artifact silently failed org/* vs com/* classification, so
nothing was deployed under mixed-privacy on Windows.
@mary-georgiou
mary-georgiou requested a review from a team as a code owner July 21, 2026 07:47
Copilot AI review requested due to automatic review settings July 21, 2026 07:47
@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod Bot changed the title Maven build: normalize Windows backslash paths when pushing artifacts PREQ-7452 Maven build: normalize Windows backslash paths when pushing artifacts Jul 21, 2026
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Jul 21, 2026

Copy link
Copy Markdown

PREQ-7452

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

This PR improves cross-platform behavior of the build-maven GitHub Action by ensuring artifact paths extracted from Maven “Installing …” log lines are normalized on Windows runners, so downstream deploy/attestation logic continues to work consistently.

Changes:

  • Normalize Windows backslash (\) separators to forward slashes (/) when extracting installed artifact paths from Maven output.
  • Update the local-repo prefix stripping logic to support both / and \ separators.
  • Add a regression test covering Windows-style Installing ... to C:\...\ .m2\repository\... log entries.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
build-maven/build.sh Normalizes .m2/repository prefix stripping for both slash styles and converts remaining \ to / for consistent artifact path matching.
spec/build-maven_spec.sh Adds a regression test verifying that Windows-style Maven “Installing” paths are normalized and emitted correctly.

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

Comment thread build-maven/action.yml Outdated
@mary-georgiou
mary-georgiou force-pushed the fix/build-maven-windows-installed-artifacts-path branch 2 times, most recently from 6df5d85 to bf75c05 Compare July 21, 2026 08:55
@mary-georgiou
mary-georgiou force-pushed the fix/build-maven-windows-installed-artifacts-path branch from bf75c05 to 55a87f4 Compare July 21, 2026 09:26
The runner image now bundles the jf CLI, so this action no longer
needs to install it itself before deploy-artifacts.sh runs.
@sonarqubecloud

Copy link
Copy Markdown

@tomverin
tomverin enabled auto-merge (squash) July 21, 2026 12:52
@tomverin
tomverin merged commit f9607fa into master Jul 21, 2026
18 checks passed
@tomverin
tomverin deleted the fix/build-maven-windows-installed-artifacts-path branch July 21, 2026 12:52
@gitar-bot

gitar-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Normalizes Windows backslash paths in Maven build artifacts and updates JFrog CLI integration, resolving the local configuration leak issue.

✅ 1 resolved
Quality: mise.local.toml copied to consumer workspace may clobber/leak config

📄 build-maven/action.yml:211-223
The setup step does cp "$ACTION_PATH_BUILD_MAVEN/mise.local.toml" mise.local.toml into the workspace root and never removes it, so a consuming repo that already has its own mise.local.toml would be overwritten, and an untracked file is left in the working tree afterward (can affect later git/dirty-tree checks). Additionally, jdx/mise-action installs every tool declared in any mise config found at that location, so a pre-existing consumer mise.toml could cause unexpected tool installs/PATH changes. Consider writing the config to a dedicated/temp location (e.g. runner.temp) and pointing mise-action at it, or cleaning up the file after the upload step.

Options

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

Comment with these commands to change the behavior for this request:

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