mojohaus/properties-maven-plugin

Unwarranted "Circular property definition" v2

Closed this issue · 0 comments

PayBas commented

Running in 1.2.0

Running the following Test Unit fails but should not. It should be possible to reference the same property twice in another property as this is not a circular reference.

@Test
public void propertyIncludesAnotherPropertyMoreThanOnceWithIntermediaries() throws MojoFailureException {
    Properties properties = new Properties();
    properties.setProperty("p1", "value");
    properties.setProperty("p2", "${p1}");
    properties.setProperty("p3", "${p2} ${p2}");

    String value = resolver.getPropertyValue("p3", properties, new Properties());

    assertEquals("value value", value);
}

Instead, we get:

Circular property definition: p3=${p2} ${p2} -> p2=${p1} -> p1=value -> p2=${p1}

Which obviously isn't true.

Related to #27