Skip to content

fix(manifest): copy sbt-generated poms out of target/ (REA-437)#1311

Open
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 3 commits into
v1.xfrom
jfblaa/rea-437-socket-manifest-scala-writes-poms-into-gitignored-target
Open

fix(manifest): copy sbt-generated poms out of target/ (REA-437)#1311
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 3 commits into
v1.xfrom
jfblaa/rea-437-socket-manifest-scala-writes-poms-into-gitignored-target

Conversation

@jfblaa
Copy link
Copy Markdown
Contributor

@jfblaa Jeppe Fredsgaard Blaabjerg (jfblaa) commented May 12, 2026

Summary

  • socket manifest scala ran sbt makePom but left every generated pom inside each subproject's target/scala-X.Y/ dir, which is gitignored in standard SBT projects — so downstream SBOM/scan steps that respect .gitignore skipped all of them.
  • After sbt finishes, copy each pom out to <projectRoot>/socket.pom.xml (or <basename(--out)>) by walking up to the nearest target/ ancestor. Mirrors what init.gradle already does on the gradle path, just from Node.
  • Tightens the success output to one list of destinations to match the gradle command's verbosity.

Linear: REA-437

Test plan

  • Run socket manifest scala . on a multi-module sbt project (e.g. circe); confirm a socket.pom.xml lands next to each subproject's target/ and that none of the destinations sit inside a target/ dir.
  • Single-module sbt project: confirm --out=./custom.pom.xml writes to that exact path.
  • --stdout / socket manifest scala --stdout . behavior unchanged.
  • socket scan create after the manifest step now picks up the generated scala manifests.

Note

Medium Risk
Moderate risk: changes filesystem output locations for socket manifest scala by copying generated POMs out of target/, which could affect downstream tooling and user expectations around --out in multi-module projects.

Overview
socket manifest scala now copies sbt-generated .pom files out of each module’s gitignored target/ directory into the project root (using the --out basename, or honoring the full --out path when only one POM is produced), and reports the copied destinations.

Adds a target/-ancestor search helper and switches from “generated” logging to listing the exported copy locations; package version is bumped to 1.1.94.

Reviewed by Cursor Bugbot for commit acd6d30. Configure here.

`socket manifest scala` runs `sbt makePom`, which writes poms into each
subproject's `target/scala-X.Y/` dir. That path is gitignored in standard
SBT projects, so downstream SBOM/scan steps that respect `.gitignore`
never see the generated manifests.

After sbt finishes, walk up from each reported `Wrote <path>.pom` to its
`target/` ancestor and copy the pom to `<projectRoot>/socket.pom.xml`
(or `<basename(--out)>`). Single-pom case with an explicit path `--out`
still honors the exact path; stdout mode unchanged. Mirrors what
`init.gradle` already does on the gradle path, just from Node since sbt
has no direct analogue of `gradle --init-script`.

Also tightens the success output to one list of destinations to match
the gradle command's verbosity.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit acd6d30. Configure here.

Comment thread src/commands/manifest/convert_sbt_to_maven.mts Outdated
Replaces the ad-hoc `(e as Error).message` cast in the pom-copy catch
block with `getErrorCause(e)` from `utils/errors.mts`, matching the
project's existing convention. Addresses cursor bugbot review on #1311.
Copy link
Copy Markdown
Contributor

@mtorp Martin Torp (mtorp) left a comment

Choose a reason for hiding this comment

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

Requesting an update to the changelog. Otherwise, looks good ✅

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.

2 participants