Onboard Maven restores to CFS - #239
Conversation
Overall AssessmentThe PR is well-structured and follows established patterns (mirrors azure-functions-openai-extension#218). The intent is clear, CI changes are symmetric between �uild.yml and �uild-and-test.yml, and the documentation is thorough. All 5 CI checks pass. Below are findings ranging from blockers to nits. Issues1. PowerShell here-string indentation will produce malformed-looking XML (Minor)In Install-MavenCredentialProvider.ps1, the @"..."@ here-string picks up the code-level indentation as literal leading spaces in every XML line:
Every line in the generated .mvn/extensions.xml will be prefixed with four spaces. The XML is still valid and Maven will parse it correctly, but it's inconsistent with the Bash script which generates clean unindented XML (via cat >"" <<EOF at column 0). Consider outdenting the here-string content to column 0 (moving the closing "@ to column 0 as well). 2. �uild.ps1 — mvn dependency:copy skips the mirror on CI if settings aren't copied yet (Low Risk, Worth Confirming)The �uild.ps1 Maven invocation: 3. pom.xml — central repository and settings.xml mirror are redundant but not conflicting (Nit)The pom.xml now declares central pointing directly to the CFS URL: And settings.xml also mirrors central to the same URL. When the mirror is active (CI, or local with -s settings.xml), the mirror wins. When it's not active (anonymous developer without the settings file), the pom.xml repository override still routes to CFS. Both are needed for different scenarios — the README explains this well. Just worth being aware that the same URL appears in two places and must be kept in sync if the feed URL ever changes. 4. pom.xml — Snapshot policy on the central CFS repoThe replaced maven.snapshots entry had false. The new central entry has both releases and snapshots enabled: 5. �ng/scripts/install-maven-credprovider.sh — Version regex escaping (Very Minor)
The ${version//./\.} substitution replaces . with . in the shell variable before passing to ERE. However, in ERE . is a literal dot (correct), but \ in a shell double-quoted string becomes , so the actual regex character class becomes . which is a literal dot. This is correct behavior but slightly confusing. A comment would help, or alternatively use [.] which is unambiguous in ERE. Not a bug. 6. settings.xml — No element (Informational)The settings.xml uses a but does not set . This is fine for CI. Just confirming there's no intention to pin the cache location for reproducibility — there isn't, and the default ~/.m2/repository is appropriate. Positives
Summary
The PR is approvable. The only item worth confirming before merge is #4 (snapshot dependency coverage in the CFS feed). The PowerShell heredoc indentation (#1) is the most visible artifact and worth a quick fix. |
|
Thanks for the review. Follow-up commit A few confirmations:
|
Swapnil Nagar (swapnil-nagar)
left a comment
There was a problem hiding this comment.
Thanks for the quick follow-up — verified the new revision (4121bc1 Document Maven settings dependency) and your responses. Status of the original findings:
build.ps1ordering (Low) — Addressed.4121bc1adds the comment documenting that CI installs authenticated settings before invoking the script and local restores use the pom-declared CFS repository. ✅- Here-string indentation (Minor) — Confirmed non-issue: the
@""...""@content inInstall-MavenCredentialProvider.ps1is at column zero on the head branch; my original note was a misread of the rendered diff. ✅ - Snapshots on
central(confirm) — Confirmed: no external snapshot dependency coordinates in the project; authenticated CFS packaging and public CI pass. ✅ - POM repo +
settings.xmlmirror / Bash version regex / default local repository — Acknowledged as intentional and consistent with the reference implementation.
All actionable items are resolved and the remaining ones are intentional design choices with clear rationale. Approving. 🚢
The 1ES network isolation CFSClean2 policy still recorded oss.sonatype.org connections. build.ps1 clones and builds azure-maven-plugins, and its azure-functions-maven-plugin pom declares a download repository under the id maven.snapshots. The mirror was scoped to central, so that id was never redirected and Maven reached Sonatype directly. Scope the mirror to external:* so every remote repository resolves through the feed regardless of the id its pom uses.
|
Heads up, I pushed The 1ES network isolation task reports CFSClean2 as NOT COMPLIANT with 5 connections to The commit scopes the mirror to Sorry for the extra round trip. Would appreciate another look once CI finishes. |
Summary
upstream-publicCFS feed.java-8-parent.This follows the Maven onboarding pattern from Azure/azure-functions-openai-extension#218.
Validation
mvn clean package -DskipTests -Dgpg.skip=true -Dspotbugs.skip=true