RunedUniverse / r4m-maven-extension

Runes4Maven (r4m) Maven Extension provides an alternative way for defining maven executions
Apache License 2.0
4 stars 1 forks source link

Bug: Forking of specific goals fails #14

Open VenaNocta opened 6 months ago

VenaNocta commented 6 months ago

Problem Sometimes specific Goals fail to be forked

~Verification required We suspect that issue this is the result of an edge case where the groupId of the forked goal is inherited from the forking goal~

Solution Implement single goal forking, without a defined phase

Example Jenkins plugins try to fork spotbugs goals, which fail with following warning and are not registered during lifecycle calculation:

[INFO] ------------------------------------------------------------------------
[INFO] Runes4Maven Extension: patching Maven
[INFO] 
[INFO] State: Core-Extension
[WARNING] goal forking not supported: com.github.spotbugs:spotbugs-maven-plugin:check forks spotbugs
[WARNING] goal forking not supported: com.github.spotbugs:spotbugs-maven-plugin:check forks spotbugs
[WARNING] goal forking not supported: com.github.spotbugs:spotbugs-maven-plugin:check forks spotbugs
[WARNING] goal forking not supported: com.github.spotbugs:spotbugs-maven-plugin:check forks spotbugs
[INFO] 
[INFO] ------------------------------------------------------------------------
VenaNocta commented 6 months ago

On detailed analysis I noticed that this warning was added because the PEM workflow, which this extension adds, does not support single/specific goal forking through the PEM configuration file and also discourages it's use.

But for backward compatibility with Maven to work, I implemented the default Maven behavior and removed the warning.

For all developers considering adding support for r4m through META-INF/r4m/plugin-pem.xml, please select a phase for your forked goal and consider running the fork with an execution (other than default). We recommend attaching all goals to phases so other developers have the option to extend your forked behavior.