We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Not sure if I'm doing something obviously wrong, but noticing odd behavior where nested placeholders aren't being properly parsed.
Setting up the simple example: local.properties
local.properties
defined.value=myValue some.value=${defined.value:${user.home}}
pom.xml
<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> <version>1.2.1</version> <executions> <execution> <id>read-properties</id> <phase>pre-clean</phase> <goals> <goal>read-project-properties</goal> </goals> <configuration> <useDefaultValues>true</useDefaultValues> <files> <file>${project.basedir}/local.properties</file> </files> </configuration> </execution> </executions> </plugin> </build>
${some.value} is resolving as myValue} (Note the unwanted }).
${some.value}
myValue}
}
Looking at the logic in https://github.com/mojohaus/properties-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/properties/DefaultValuesAwareExpansionBufferImpl.java#L32-L43 (and related logic in https://github.com/mojohaus/properties-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/properties/ExpansionBuffer.java#L60-L81)
It doesn't seem, offhand, that nested placeholders are being properly accounted for, or am I making a silly mistake?
The text was updated successfully, but these errors were encountered:
Any thoughts on this? I can work on a change if it's appropriate, I just wanted to check if I'm using it incorrectly first, since the documentation seems to indicate that the above use case should be valid. https://www.mojohaus.org/properties-maven-plugin/#:~:text=localhost%7D%3A%24%7Bport%3A8080%7D-,%24%7Bunknown%3A%24%7Bfallback%7D%7D,-fallback%20value
Sorry, something went wrong.
Your example looks ok.
You can try to add a Unit Test into: src/test/java/org/codehaus/mojo/properties/PropertyResolverTest.java with your case.
Looks like a bug.
Added #118 to add a test to expose the issue.
No branches or pull requests
Not sure if I'm doing something obviously wrong, but noticing odd behavior where nested placeholders aren't being properly parsed.
Setting up the simple example:
local.properties
pom.xml
${some.value}
is resolving asmyValue}
(Note the unwanted}
).Looking at the logic in https://github.com/mojohaus/properties-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/properties/DefaultValuesAwareExpansionBufferImpl.java#L32-L43 (and related logic in https://github.com/mojohaus/properties-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/properties/ExpansionBuffer.java#L60-L81)
It doesn't seem, offhand, that nested placeholders are being properly accounted for, or am I making a silly mistake?
The text was updated successfully, but these errors were encountered: