You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Shane Isbell <sh...@gmail.com> on 2009/03/25 19:12:36 UTC

Changing Boolean Values in Maven Model to Strings?

I thought I would raise this on the general list since it could involve API
changes in the Maven Model for Maven 3.0. I've run into a situation where
Boolean values in Maven model are causing problems with interpolation.The
general issue is here: http://jira.codehaus.org/browse/MNG-1995

I've put in a hierarchical based model builder that does not modify the
original models but rather copies the values into a target model as it
builds the inheritance tree. The process is inheritance first, then
interpolation. The problem occurs because a boolean value that contains an
uninterpolated property always returns false, which means that the copy is
always a value of false, not the property itself, which may have
interpolated to a value true. In the Jira issue, John mentioned changing in
the Boolean to String, which would solve the problem here. Thoughts?

Thanks,
Shane

Re: Changing Boolean Values in Maven Model to Strings?

Posted by Benjamin Bentmann <be...@udo.edu>.
Shane Isbell wrote:

> In the Jira issue, John mentioned changing in
> the Boolean to String, which would solve the problem here.

+1

John's own concern with this approach was backward-compat with the 
existing plugins but I think we can keep compat by following the same 
pattern that Brett used to fix MNG-1999:
- Change the field type and rename it in the model
- Map the model element to the old XML tag via Modello's xml.tagName 
attribute
- Provide adapter methods that support the old API

This way, the API changes should be limited to method additions which 
shouldn't affect existing code.


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org