-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MNG-7691] Lifecycle filter #1086
base: maven-3.9.x
Are you sure you want to change the base?
Conversation
A rough concept how could it work: this skipper simply plugs into lifecycle calculator and skips (removes) filtered out MojoExecutions. Expression is simple: G[:A[:g[:e]]] Where G means "groupId" and can be: * "" (empty string) -- means "default plugin groupIds" (as in user settings) * "*" (asterisk) -- any * "string" -- string equality for groupId A (artifactId), g (goal) and e (executionId) may have values: * "*" (asterisk) -- any * "string" -- string equality for artifactId, goal or executionId respectively.
The proposed syntax is problematic to me as it's not coherent with the one displayed to the user.
so we need to use a syntax which actually supports what is displayed such as |
I disagree here. Plugin prefix may be duplicated AFAIK, |
To demonstrate: https://github.com/cstamas/plugin-clash/blob/main/README.md (and project that creates two different GA plugins and use them in build). Hence, IMHO any coherence with console output would be misleading: prefix cannot uniquely identify a plugin |
I'm not sure how that's relevant. Your syntax supports wildcards, which definitely cannot uniquely identify a plugin. My points is not to restrict the supported syntax to For example, how can you simply relate I'd like to find a syntax that would support just copy/pasting the output from the console, certainly not be limited to that. |
I propose the following syntax:
|
I like it. Will apply needed changes. |
One question remaining i was thinking about:
|
If passed as an argument / option, it will be subject to interpolation with #1062 |
A rough concept how could it work: this skipper simply plugs into lifecycle calculator and skips (removes) filtered out MojoExecutions.
Expression is simple:
G[:A[:g[:e]]]
(comma separated)Where
G
means "groupId" and can be:""
(empty string) -- means "default plugin groupIds" (as in user settings)"*"
(asterisk) -- any"string"
-- string equality for groupIdA
(artifactId),g
(goal) ande
(executionId) may have values:"*"
(asterisk) -- any (implied if not given)Examples:
-Dmaven.lifecycle.filter=
(same as "" empty string) - any plugin in "default" plugin groups (by default org.apache.maven.plugins and org.codehaus.mojo)-Dmaven.lifecycle.filter=:buildnumber-maven-plugin,:maven-enforcer-plugin
-- buildnumber codehaus and enforcer ASF plugin-Dmaven.lifecycle.filter=:*:*:enforce-java-version
- any "default" plugin execution with execution ID of "enforce-java-version"-Dmaven.lifecycle.filter=*
- exclude all (funnily, maven will happily do nothing, no mojo will run)Example invocations (only with relevant output):
https://issues.apache.org/jira/browse/MNG-7691