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

Merged
2Y
2d ago
+17-7

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 #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.