Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolveCiFriendliesOnly garbles non ci-friendly property-placeholder if used in the same property #401

Open
mmusenbr opened this issue Jan 22, 2024 · 0 comments

Comments

@mmusenbr
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant