File based profile activation expanded to full path in original model

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

File based profile activation expanded to full path in original model

GLIMMERVEEN Arnoud
Hi all,

I am looking at an issue I encountered while using a Maven plugin that uses model returned by MavenProject.getOriginalModel(). I noticed that it returns a Model that is not interpolated (what I expected), with the exception to paths related to file based profile activation. Both when the referenced file is a relative path or when a property is used, the full path is referenced in the original model, rather then the relative path/property related path used in the actual pom file. When this original model is subsequently used to replace the pom file from the file system, it no longer contains the correct activation paths for the profiles.

Did a run into an issue here or is it expected that the original model may contain interpolated properties in relation to profile activation?

During debugging I noticed that where the model is loaded (DefaultModelBuilder) two Model objects are maintained (tmpModel and rawModel), and that the 'rawModel' is used to determine the active profiles. It is in that logic the profile activation gets updated with expanded paths. Would it be possible to use tmpModel for the purpose of determining the active profiles instead?

Best regards,

Arnoud Glimmerveen


------------------------------------------------------------------------------------------------------------
Disclaimer:

If you are not the intended recipient of this email, please notify the sender and
delete it.
Any unauthorized copying, disclosure or distribution of this email or its
attachment(s) is forbidden.
Thales Nederland BV will not accept liability for any damage caused by this email or
its attachment(s).
Thales Nederland BV is seated in Hengelo and is registered at the Chamber of
Commerce under number 06061578.
------------------------------------------------------------------------------------------------------------