[ https://issues.apache.org/jira/browse/MNG-6435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16564276#comment-16564276 ]
Laird Nelson commented on MNG-6435: ----------------------------------- Compatibility is tricky here. Thanks to the design, I _think_ if you had some stuff in your {{settings.xml}} like this: {code:java} <${project.artifactId}>hello</${project.artifactId}> {code} …it should work (which is a little crazy). The serialization, in other words, dumps the whole {{settings.xml}} (XML tokens and all) into a {{String}} and then performs interpolation on the resulting {{String}}. I'm not sure there's any other solution than my approach above if that behavior has to be maintained. > DefaultSettingsBuilder assumes all SettingsReader/Writer impls will use XML > --------------------------------------------------------------------------- > > Key: MNG-6435 > URL: https://issues.apache.org/jira/browse/MNG-6435 > Project: Maven > Issue Type: Improvement > Components: Settings > Affects Versions: 3.5.3 > Reporter: Laird Nelson > Priority: Minor > > On or around line 234, interpolation of settings assumes XML: > {code} > interpolator.addPostProcessor( new InterpolationPostProcessor() > { > @Override > public Object execute( String expression, Object value ) > { > if ( value != null ) > { > // we're going to parse this back in as XML so we need to escape XML > markup > value = value.toString().replace( "&", "&" ).replace( "<", "<" > ).replace( ">", ">" ); > return value; > } > return null; > } > } ); > {code} > The value being interpolated here is the result of a {{SettingsWriter}}'s > output. Obviously this kind of escaping doesn't make any sense if the > {{SettingsWriter}} in question is not XML-based. -- This message was sent by Atlassian JIRA (v7.6.3#76005)