apache / apache/maven

[MNG-7691] Provide a generic way to skip Maven Goals for a specified plugin

Open
#8,759 7 comments 0 reactions 0 assignees View on GitHub
enhancement priority:major
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Jimisola Laursen](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=JIRAUSER281352)** opened **[MNG-7691](https://issues.apache.org/jira/browse/MNG-7691?redirect=false)** and commented

From ([Baeldung](https://www.baeldung.com/maven-disable-parent-pom-plugin):

"Many plugins feature a skip parameter. We can use the skip parameter to disable the plugin. Support for the skip parameter should be the first thing we check because it is the simplest solution and the most conventional.".

I was thinking that there should be a generic way to skip maven plugin goals in the core of Maven, i.e. it should not have to be implemented in each plugin.

Would something like this work?

-Dmaven.skip.goals=groupID:artifactId:goal (is there a need to specify version?)

E.g.

-Dmaven.skip.goals=io.spring.javaformat:spring-javaformat-maven-plugin:apply

-Dmaven.skip.goals=io.spring.javaformat:spring-javaformat-maven-plugin:apply+validate

-Dmaven.skip.goals=io.spring.javaformat:spring-javaformat-maven-plugin:apply+validate,org.apache.maven.plugins:maven-enforcer-plugin:enforce

---

**Issue Links:**
- [MNG-7092](https://issues.apache.org/jira/browse/MNG-7092) Core mechanism for skipping mojos

- [MNG-8049](https://issues.apache.org/jira/browse/MNG-8049) Provide a generic way to "target" some step in build

**Remote Links:**
- [GitHub Pull Request #1086
](https://github.com/apache/maven/pull/1086)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.