apache / apache/maven

[MNG-7092] Core mechanism for skipping mojos

Open
#8,356 4 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

**[Peter Palaga](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=ppalaga)** opened **[MNG-7092](https://issues.apache.org/jira/browse/MNG-7092?redirect=false)** and commented

The current practice is that mojo authors have to implement skipping on their side. It is easy to do, but it has a couple of disadvantages:

* Not every mojo has a skip option
* The naming conventions differ among mojos
* Performance: the dependencies of the mojo need to be resolved, downloaded, classes loaded and initialized, config injected only to eval the skip option and do nothing. I have collected some numbers in https://peter.palaga.org/2020/10/29/skipping-maven-mojos-properly.html .

I wonder if Maven core could provide a mechanism for skipping mojos without the above drawbacks?

There could be some global naming convention, so that `-Dorg.my-org.my-maven-plugin.my-mojo.skip` or just `-Dmy.my-mojo.skip` would skip `my-mojo`.

WDYT?

---

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

- [MNG-7691](https://issues.apache.org/jira/browse/MNG-7691) Provide a generic way to skip Maven Goals for a specified plugin

1 votes, 3 watchers

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.