Skip to content

Commit 560b147

Browse files
committed
fix(manifest): default sbt pom output to pom.xml for scan discovery
Match the gradle init script's convention by writing the sbt-generated manifest as pom.xml at the project root above target/, so Socket scan's **/pom.xml glob picks it up automatically. Help text documents --out as the escape hatch when a hand-authored pom.xml exists at the root.
1 parent 0dc3d3c commit 560b147

5 files changed

Lines changed: 12 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
77
## [1.1.94](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.94) - 2026-05-12
88

99
### Fixed
10-
- `socket manifest scala` now copies sbt-generated `.pom` files out of each subproject's `target/` directory to the project root, so downstream SBOM and scan steps that respect `.gitignore` can see the generated manifest files.
10+
- `socket manifest scala` now copies sbt-generated `.pom` files out of each subproject's `target/` directory to the project root as `pom.xml`, so Socket scan (which discovers `**/pom.xml` and respects `.gitignore`) picks them up automatically. Use `--out` to override the destination filename.
1111

1212
## [1.1.93](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.93) - 2026-05-08
1313

src/commands/manifest/cmd-manifest-scala.mts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ const config: CliCommandConfig = {
5959
6060
There are some caveats with \`build.sbt\` to \`pom.xml\` conversion:
6161
62-
- the xml is exported as socket.pom.xml as to not confuse existing build tools
63-
but it will first hit your /target/sbt<version> folder (as a different name)
62+
- the xml is exported as pom.xml at the project root so Socket scan picks
63+
it up; sbt itself first writes it inside your /target/sbt<version> folder
64+
(as a different name). Use --out to override if you already have a
65+
hand-authored pom.xml at the project root.
6466
6567
- the pom.xml format (standard by Scala) does not support certain sbt features
6668
- \`excludeAll()\`, \`dependencyOverrides\`, \`force()\`, \`relativePath\`
@@ -148,7 +150,7 @@ async function run(
148150
out = sockJson.defaults?.manifest?.sbt?.outfile
149151
logger.info(`Using default --out from ${SOCKET_JSON}:`, out)
150152
} else {
151-
out = './socket.pom.xml'
153+
out = './pom.xml'
152154
}
153155
}
154156
if (!sbtOpts) {

src/commands/manifest/cmd-manifest-scala.test.mts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ describe('socket manifest scala', async () => {
3535
3636
There are some caveats with \`build.sbt\` to \`pom.xml\` conversion:
3737
38-
- the xml is exported as socket.pom.xml as to not confuse existing build tools
39-
but it will first hit your /target/sbt<version> folder (as a different name)
38+
- the xml is exported as pom.xml at the project root so Socket scan picks
39+
it up; sbt itself first writes it inside your /target/sbt<version> folder
40+
(as a different name). Use --out to override if you already have a
41+
hand-authored pom.xml at the project root.
4042
4143
- the pom.xml format (standard by Scala) does not support certain sbt features
4244
- \`excludeAll()\`, \`dependencyOverrides\`, \`force()\`, \`relativePath\`

src/commands/manifest/convert_sbt_to_maven.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export async function convertSbtToMaven({
116116
// typically gitignored. Copy them out to a sibling of `target/` so
117117
// downstream SBOM/scan steps see them.
118118
const copied: string[] = []
119-
const outBasename = path.basename(out) || 'socket.pom.xml'
119+
const outBasename = path.basename(out) || 'pom.xml'
120120
for (const pomPath of poms) {
121121
let destPath: string
122122
if (poms.length === 1 && out !== outBasename) {

src/commands/manifest/generate_auto_manifest.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export async function generateAutoManifest({
3434
// Note: `sbt` is more likely to be resolved against PATH env
3535
bin: sockJson.defaults?.manifest?.sbt?.bin ?? 'sbt',
3636
cwd,
37-
out: sockJson.defaults?.manifest?.sbt?.outfile ?? './socket.sbt.pom.xml',
37+
out: sockJson.defaults?.manifest?.sbt?.outfile ?? './pom.xml',
3838
sbtOpts:
3939
sockJson.defaults?.manifest?.sbt?.sbtOpts
4040
?.split(' ')

0 commit comments

Comments
 (0)