keeping the original ${project.basedir} by using MavenProject.setPomFile method #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My web application build was incomplete after adding the flatten plugin into my flow.
I was using a custom configuration and putting the flattened pom file into "target/myartifact-flat.pom" ("${project.build.directory}/${project.build.finalName}-flat.pom"). Putting it there seemed logical to me, and all other projects before WAR were working correctly.
The reason it didn't work for WAR is that MavenProject.setFile() modifies the ${project.basedir}. Plugins that run after will see the wrong value, and maven-war-plugin is a plugin that uses that value.
This simple patch resolves the problem, but unfortunately it raises maven requirements to 3.2.5 (setPomFile was added in maven 3.2.4, but for some reason that version is not available).
Here is the commit that introduced this call. It seems to be added specifically to support POM editing.
apache/maven@c15226f