Fix: Empty Build Info When Using Maven Plugin Goals#406
Conversation
| 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") { |
There was a problem hiding this comment.
we can use an array to store this, and you can search using strings.contain
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
I meant something like arr := [":deploy", "deploy", "deploy:"]
and arr.Contains(":deploy")
arr can be reusable down the line
looks good?
| if goal == "install" || goal == "deploy" { | ||
| return true | ||
| } | ||
| if (strings.HasPrefix(goal, "deploy:") || strings.HasPrefix(goal, "install:")) && |
There was a problem hiding this comment.
what about ":deploy" and ":install", there inconsistency w.r.t above file
There was a problem hiding this comment.
you can also us the above discussed array here
ee7b826 to
dc62ec4
Compare
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 formatplugin:goal(e.g.,"deploy:deploy-file").This causes:
deploy:deploy-filenot recognized as deployment goalpublish.add.deployable.artifacts = "false"is setLog Evidence: