Skip to content

Fix: Empty Build Info When Using Maven Plugin Goals#406

Merged
agrasth merged 3 commits intojfrog:mainfrom
agrasth:bugfix/RTECO-931
Apr 8, 2026
Merged

Fix: Empty Build Info When Using Maven Plugin Goals#406
agrasth merged 3 commits intojfrog:mainfrom
agrasth:bugfix/RTECO-931

Conversation

@agrasth
Copy link
Copy Markdown
Collaborator

@agrasth agrasth commented Mar 24, 2026

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • All static analysis checks passed.
  • Appropriate label is added to auto generate release notes.
  • I used gofmt for formatting the code before submitting the pull request.
  • PR description is clear and concise, and it includes the proposed solution/fix.

Fix: Empty Build Info When Using Maven Plugin Goals (deploy:deploy-file)

Error: Build promotion succeeds but artifacts aren't actually promoted. Setting properties fails with 404 (artifacts not found in repository).

Root Cause

The isDeploymentRequested() function only checks for exact string matches of "install" or "deploy", but Maven plugin goals use the format plugin:goal (e.g., "deploy:deploy-file").

This causes:

  1. deploy:deploy-file not recognized as deployment goal
  2. publish.add.deployable.artifacts = "false" is set
  3. Build Info Extractor skips artifact collection
  4. Build info published with only dependencies, no artifacts

Log Evidence:

[main] INFO org.jfrog.build.extractor.maven.BuildInfoRecorder - Artifact metadata not requested - skipping artifact collection for build info

@agrasth agrasth added the improvement Automatically generated release notes label Mar 25, 2026
if arg == "deploy" || strings.HasSuffix(arg, ":deploy") {
// Match standalone "deploy" goal or any deploy plugin goal
// Examples: deploy, deploy:deploy, deploy:deploy-file, maven-deploy-plugin:deploy
if arg == "deploy" || strings.HasPrefix(arg, "deploy:") || strings.HasSuffix(arg, ":deploy") {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we can use an array to store this, and you can search using strings.contain

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Contains() creates false positives by matching substrings anywhere in the goal name (e.g., "uninstall" contains "install", "reinstall" contains "install")
If we use this we might have to handle more cases separately, WDYT?

Copy link
Copy Markdown
Collaborator

@fluxxBot fluxxBot Mar 25, 2026

Choose a reason for hiding this comment

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

I meant something like arr := [":deploy", "deploy", "deploy:"]
and arr.Contains(":deploy")

arr can be reusable down the line
looks good?

Comment thread artifactory/commands/mvn/mvn.go Outdated
if goal == "install" || goal == "deploy" {
return true
}
if (strings.HasPrefix(goal, "deploy:") || strings.HasPrefix(goal, "install:")) &&
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what about ":deploy" and ":install", there inconsistency w.r.t above file

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

you can also us the above discussed array here

@agrasth agrasth merged commit fb3f40f into jfrog:main Apr 8, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Automatically generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants