apache / apache/maven

[MNG-5521] Merge plugin lifecycle execution with actual build

Open
#6,801 1 comment 0 reactions 0 assignees View on GitHub
enhancement priority:minor
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 40m
Merged PRs (30d)
275

Description

**[Sander Verhagen](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=sverhagen)** opened **[MNG-5521](https://issues.apache.org/jira/browse/MNG-5521?redirect=false)** and commented

Plugins annotated with `@Execute` (org.apache.maven.plugins.annotations.Execute) will run a build for the specified lifecycle phase, regardless of anything previously executed. This is relevant when such plugin is defined within the lifecycle, but may even be relevant if the plugin is defined on the command-line following a lifecycle build (e.g.: mvn process-classes tomcat7:run).

This has two negative consequences:

1. Even if the build was already advanced to or past the specified lifecycle phase, a build for the specified lifecycle phase will be spun off which redoes the build for no good reason

2. While the build for the specified lifecycle phase is performed, it may undo any previous more advanced build. E.g. if the specified lifecycle phase is "compile", but the plugin is executed in the "test" phase, any results of the "process-classes" phase may be undone

An example of the problems caused with this can be found here: http://stackoverflow.com/questions/18965550/influence-the-lifecycle-execution-that-a-maven-plugin-executes-tomcat7run#comment28012573_18965550

---

**Affects:** 3.0.5

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.