[MNG-7353] support CLI "mvn pluginPrefix:version:goal"#757
[MNG-7353] support CLI "mvn pluginPrefix:version:goal"#757hboutemy merged 1 commit intomaven-3.9.xfrom
Conversation
|
|
||
| String firstToken = tok.nextToken(); | ||
| // groupId or pluginPrefix? heuristics: groupId contains . but not pluginPrefix | ||
| if ( firstToken.contains( "." ) ) |
There was a problem hiding this comment.
I don't think we can make this assumption for sure since for testing or other reasong the groupId could be: foo, bar-baz
There was a problem hiding this comment.
if you want to test a plugin for such simplified run, just don't define such a groupId
at least, it seems to work for real world plugins, that's the first intent
of course, if you find a better heuristics, or even an algorithm, I'm all ears open
There was a problem hiding this comment.
I gave it some thought, but I can't find a better heuristic either. The only thing more or less foolproof would be to look at the first token, assuming it is a plugin prefix. If that lookup yields nothing, it would be a groupId.
Even that is not 100% safe, though. Imagine you're not connected to the network, so lookup fails, so we decide it's a groupId -- this certainly doesn't make sense. But more importantly, it's probably quite costly compared to a String.contains :-).
There was a problem hiding this comment.
and do you really think that we'll have any single word groupId in the future, given Maven Central explicitely asks for DNS matching?
heuristics is heuristics: in theory there could be edge cases, but in real world, it simply works
There was a problem hiding this comment.
This indeed breaks real-world projects. We're using a single word groupId internally and invoking maven using mvn groupId:artifactId:goal@executionId no longer works starting with Maven 3.8.8.
mthmulders
left a comment
There was a problem hiding this comment.
I like this feature a lot. Would it be possible to add an IT for it?
I second that. |
|
IT added, that checks every CLI goal invocation format (with or without executionId) please review |
|
Thanks for the IT. I've learned about Since there's no PR for the IT, let me ask one question here: I noticed the name of the test methods all start with |
Looking at the CI job for this PR, I see it detected the branch in m-i-t correctly and ran the new tests correctly: |
|
Will test this week... |
|
on Junit 4 vs 5: I'm not a purist, I just copied from others, it's so basic :) |
michael-o
left a comment
There was a problem hiding this comment.
All good. I have already rebased and cleaned up for you. You just need to merge! Allez !
|
Resolve #8080 |

https://issues.apache.org/jira/browse/MNG-7353