in maven-model-builder, the file pom-4.0.0.xml defines "release-profile" which binds some executions to the lifecycle.
One of them is source:jar - which forks the build. That can be a problem in some configurations, and the forking is probably not necessary.
One situation where the forked build hurts is this:
- I have checkstyle:check attached to phase "validate"
- some of my modules generate code, obviously not compliant to the checkstyle
The problem is that, inside forked build, the checkstyle:check is called again, but now it checks also the generated code (because target/ is no longer empty). And of course fails.
Even worse: during normal development iterations, everything is fine. But when I have to issue a release (usually under some pressure), I hit this problem.
Fortunately, there is a workaround: override the execution "attach-sources" and assign it to a non-existing phase, and define execution with different id for that.
But it is too ugly and I believe that the simple fix would solve it - for the meantime before the whole profile is removed.