You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MNG-5885] Optimize execution when phases of same lifecycle are called #7772
In case someone calls compile package there's no need for the separate compile call. Now the lifecycle is executed twice: once until compile and once again until package.
Note: package compile is weird due to its order, but should not be optimized. compile resources:copy-resources package is a bit complicated. Ideally this should call all phases up until compile, followed by resources:copy-resources, followed by the process-classes to package phases.
I tend to agree with you but for a different reason. First, "compile package" does not look like garbage; it looks like someone just explicitly listed out the phases they are most interested in. However, it's surprising this is not a runtime error, honestly. I don't believe optimizing is the right solution here but rejecting the syntax altogether. I don't believe we should allow more than one phase to be explicitly listed.
An error is way too offensive to me. And I expect that the meaning of this command gets a new meaning in a multimodule project: run up this phase for every module before continuing up until the next phase. I still need to work on this...
Activity
jira-importer commentedon Dec 18, 2015
Christian Schulte commented
If someone tells Maven to execute 'compile package', it should do just that. Garbage in -> garbage out, IMHO.
jira-importer commentedon Feb 3, 2016
Paul Benedict commented
I tend to agree with you but for a different reason. First, "compile package" does not look like garbage; it looks like someone just explicitly listed out the phases they are most interested in. However, it's surprising this is not a runtime error, honestly. I don't believe optimizing is the right solution here but rejecting the syntax altogether. I don't believe we should allow more than one phase to be explicitly listed.
jira-importer commentedon Dec 8, 2017
Daniel Cruver commented
A potential solution to this is to detect when phases of the same lifecyle are adjacent to each other on the command line an report a run-time error.
For example:
mvn clean install deploy
ERROR: the phases install and deploy both belong to the 'default' Lifecycle, please build with the command 'mvn clean deploy'.
jira-importer commentedon Dec 8, 2017
Robert Scholte commented
An error is way too offensive to me. And I expect that the meaning of this command gets a new meaning in a multimodule project: run up this phase for every module before continuing up until the next phase. I still need to work on this...