#57 Prevent interpolation of a profile activation file #152
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.
Fixes #57
Relates #114
Relates MNG-6802, MNG-5612
A profile activation file is being interpolated during
flatten-maven-pluginrun.Example
Result
The root of the problem in FileProfileActivator.isActive()
method.
It is called in DefaultModelBuilder.build().
Which happens here.
That's why
rawModelhas already interpolated the file path.It means when
flatten-maven-plugincalls this.project.getOriginalModel()it returns already interpolated activation file.
As a solution, we can load a raw model directly from the
pom.xml.That's why I introduced method
getOriginalModel()which loadsModelfrom the properpom.xml.During troubleshooting, I added a unit-ish test
FlattenMojoTestto be able to debug.
That's why I added
maven-plugin-testing-harnessandmaven-compatdependencies. I can remove the test if you wish.
@hohwille @rfscholte could you take a look.
If you agree that
FileProfileActivator.isActive()has a bug because it updates the input parameterprofile, I'll be happy to fix it.