resolveCiFriendliesOnly garbles non ci-friendly property-placeholder if used in the same property
mmusenbr opened this issue · comments
Hi,
having a property which contains multiple property-placeholders, at least one of them is a CI-Friendly placeholder (revision, sha1, changelist) and at least on of the is a non-CI-Friendly placeholder, eg:
<test1.prop>HELLO${hello}${changelist}</test1.prop>
Running mvn org.codehaus.mojo:flatten-maven-plugin:1.6.0:flatten process-resources -Dflatten.mode=resolveCiFriendliesOnly -Drevision=1.2.3 -Dchangelist='' -Dsha1=''
on the following pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>my.group</groupId>
<artifactId>flatten-test</artifactId>
<version>${revision}${sha1}${changelist}</version>
<packaging>pom</packaging>
<properties>
<hello>me</hello>
<test1.prop>HELLO${hello}${changelist}</test1.prop>
<test2.prop>HELLO${hello}</test2.prop>
</properties>
</project>
Produces the following testX.prop-values in the flattened pom:
<properties>
<test2.prop>HELLO${hello}</test2.prop>
<test1.prop>HELLOhello</test1.prop>
<hello>me</hello>
</properties>
As seen, test2.prop does not initially contains a ci-friendly placeholder and is not modified my the plugin. But as test1.prop contains one, the non-ci-friendly has the ${
and }
stripped.