Skip to content

feat: add mavenDebugOutput option for logging raw Maven command output#215

Open
z4ce wants to merge 1 commit into
masterfrom
feat_mvn_debug_output
Open

feat: add mavenDebugOutput option for logging raw Maven command output#215
z4ce wants to merge 1 commit into
masterfrom
feat_mvn_debug_output

Conversation

@z4ce

@z4ce z4ce commented Mar 25, 2026

Copy link
Copy Markdown

Introduced mavenDebugOutput boolean option to enable logging of raw Maven command output during execution.

  • Ready for review
  • Follows CONTRIBUTING rules
  • Reviewed by Snyk internal team

What does this PR do?

Introduces a new flag (mavenDebugOutput) to print maven stdout/stderr with snyk --debug is being used.

I created this after debugging an issue with maven caching. It was hard to tell if snyk was caching the output or not.It's not possible to tell if caching is being used right now without running maven commands by hand which can be difficult in CI situations. This is what the output looks like:

2026-03-25T03:39:51.878Z snyk-mvn-plugin Child process exited with code: 0
2026-03-25T03:39:51.878Z snyk-mvn-plugin Maven version: Apache Maven 3.9.12 (848fbb4bf2d427b72bdb2471c22fced7ebd9a7a1), explicit plugin version: 3.9.0
2026-03-25T03:39:51.879Z snyk-mvn-plugin Maven command: mvn dependency:tree -DoutputType=dot --batch-mode --non-recursive --file pom.xml
2026-03-25T03:39:51.879Z snyk-mvn-plugin Maven working directory: /Users/ianzink/git/maven-monorepo-example
2026-03-25T03:39:51.879Z snyk-mvn-plugin Verbose enabled: false
2026-03-25T03:39:53.583Z snyk-mvn-plugin Child process exited with code: 0
2026-03-25T03:39:53.583Z snyk-mvn-plugin >>> Maven dependency:tree output (mvn dependency:tree -DoutputType=dot --batch-mode --non-recursive --file pom.xml):
2026-03-25T03:39:53.583Z snyk-mvn-plugin [INFO] Scanning for projects...
[INFO]
[INFO] -----------------< org.example:maven-monorepo-example >-----------------
[INFO] Building maven-monorepo-example 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- dependency:3.3.0:tree (default-cli) @ maven-monorepo-example ---
[INFO] digraph "org.example:maven-monorepo-example:pom:1.0-SNAPSHOT" {
[INFO]  }
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.776 s
[INFO] Finished at: 2026-03-25T14:39:53+11:00
[INFO] ------------------------------------------------------------------------

2026-03-25T03:39:53.583Z snyk-mvn-plugin Metaversions detected: false
2026-03-25T03:39:53.583Z snyk-mvn-plugin No metaversions detected - using no-op resolver for optimal performance

Where should the reviewer start?

How should this be manually tested?

Run snyk test --mavenDebugOutput --debug see the maven output displayed.

Any background context you want to provide?

What are the relevant tickets?

Screenshots

Additional questions

@CLAassistant

CLAassistant commented Mar 25, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@snyk-io

snyk-io Bot commented Mar 25, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Introduced `mavenDebugOutput` boolean option to enable logging of raw Maven command output during execution.
@z4ce z4ce force-pushed the feat_mvn_debug_output branch from 73c31ac to fb6b847 Compare March 25, 2026 03:44
@z4ce z4ce marked this pull request as ready for review March 27, 2026 02:32
@z4ce z4ce requested review from a team as code owners March 27, 2026 02:32
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