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

JBakeConfiguration.addConfiguration should overwrite existing properties #717

Open
kwin opened this issue Jul 26, 2021 · 0 comments · May be fixed by #718
Open

JBakeConfiguration.addConfiguration should overwrite existing properties #717

kwin opened this issue Jul 26, 2021 · 0 comments · May be fixed by #718

Comments

@kwin
Copy link
Contributor

kwin commented Jul 26, 2021

Currently the properties added via JBakeConfiguration.addConfiguration are not overwriting same name configuration keys already set in the config. This is due to the fact that the configuration is merged with CompositeConfiguration.addConfiguration(...) in

compositeConfiguration.addConfiguration(new MapConfiguration(properties));
while it should use CompositeConfiguration.addConfigurationFirst().

This is important for the jbake-maven-plugin which calls https://github.com/jbake-org/jbake-maven-plugin/blob/e550c42b1cea4b360c5bc81183ecc87122a4291e/src/main/java/org/jbake/maven/GenerateMojo.java#L94. That way it would be possible to overwrite existing values in the jbake.properties with e.g. Maven profile specific values.

This is especially important as the existing configuration contains all keys from both local and default jbake.properties already (

private CompositeConfiguration load(File source, File propertiesFile) throws ConfigurationException {
).

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

Successfully merging a pull request may close this issue.

1 participant