Skip to content

fix(java): write the Maven POM scm url with https:// - #156

Merged
2ynn merged 3 commits into
test/config-validation-examplesfrom
fix/java/scm-url
Oct 27, 2026
Merged

2ynn merged 3 commits into
test/config-validation-examplesfrom
fix/java/scm-url

Conversation

@2ynn

@2ynn 2ynn commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #155, which normalizes githubURL before the POM links are written (LocalComputed.GithubURL). Review after #155; this PR will be retargeted once #155 merges.

Why

templates/templates/javav2/auxiliary/publishing.gradle.stmpl writes three POM links from githubURL. The project url and the SCM connection are complete, but the SCM url is the bare value:

url = 'https://github.com/owner/repo'
scm {
    url = 'github.com/owner/repo'
    connection = 'scm:git:ssh://git@github.com/owner/repo.git'
}

The Maven POM reference defines <scm><url> as "a publicly browsable repository". Without a scheme it is not an absolute URL, so tools that turn it into a link cannot open it. Publishing is not affected: Maven Central only requires the element to be present.

Building on #155 matters here: with the raw value, prefixing https:// would double the scheme for a githubURL such as https://github.com/acme/acme-java, whose SCM url is currently correct.

What changed

  • publishing.gradle.stmpl: SCM url is now https://{{.LocalComputed.GithubURL}}, like the project url.
  • zSDKs/sdk-javav2: regenerated with TARGET=review make build-javav2; publishing.gradle changes only in that line, plus its gen.lock checksum.
  • Changeset: core / javav2 patch.

Testing

  • TestJavaPublishingLinksNormalizeGithubURL (from fix(go,mcp,php,java): declare config validation examples and fix the patterns they expose #155) now expects https:// in the SCM url for every case and passes.
  • TARGET=review make build-javav2: passes; the diff is the one scm.url line and its checksum.
  • cmd/generate -l java -p with githubURL: https://github.com/acme/acme-java writes https://github.com/acme/acme-java for both URLs and scm:git:ssh://git@github.com/acme/acme-java.git for the connection.
  • Not run: publishing to a Maven repository.

Public-safety check

  • This change contains no credentials, customer documents, private repository URLs, private filesystem paths, or unredacted private logs.
  • Title, body, comments, and commit messages name no customers or customer-derived identifiers, private paths or trackers, or workflow provenance, and are understandable without private context (.claude/skills/public-repo-communication/SKILL.md).
  • Generated fixtures and review SDK changes are public-safe.
  • I reviewed git diff --check.

publishing.gradle wrote the POM scm url as the bare githubURL value,
such as github.com/owner/repo, while the project url on the line above
already gets https://. Maven defines scm url as a browsable repository
URL, and without a scheme it is not an absolute URL, so tools that link
it cannot open it. Prefix it with https:// like the project url.
@github-actions github-actions Bot added the java Trigger (40) snapshot tests for java label Oct 26, 2026

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would require human review. This PR makes the Maven POM SCM url absolute by prefixing https://, but correctness depends on #155 normalizing githubURL to a bare value; that normalization is not visible in the diff, so the fix and its merge ordering cannot be verified here.

View guided diff | Turn on auto-fix | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot 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.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Fixes the generated Maven POM SCM url to be an absolute https URL, building on the githubURL normalization already in place and covered by tests that pin canonical, scheme/www/.git, uppercase, and non-string inputs. The change is bounded, focused, and clearly beneficial.

View guided diff | Turn on auto-fix | Re-trigger cubic

@2ynn
2ynn marked this pull request as ready for review October 26, 2026 21:00
@2ynn
2ynn requested a review from a team as a code owner October 26, 2026 21:00
@2ynn
2ynn requested review from speakeasybot and removed request for a team October 26, 2026 21:00
@speakeasy-generator-bot

speakeasy-generator-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Generator Snapshot Testing

Selector(s) Result Summary
snapshot-java ✅ Snapshot run completed

Snapshot results: https://github.com/speakeasy-api/openapi-generation-snapshots/issues/139#issuecomment-6427273221

Snapshot results are summarized above. Additional run context is linked for maintainers with access.

@TristanSpeakEasy TristanSpeakEasy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, using the normalised URL here avoids doubling the scheme and gives scm.url a proper browsable link.

@2ynn
2ynn merged commit 78997c1 into test/config-validation-examples Oct 27, 2026
27 checks passed
@2ynn
2ynn deleted the fix/java/scm-url branch October 27, 2026 13:18
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

java Trigger (40) snapshot tests for java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants