Skip to content

JBakeConfiguration.addConfiguration should overwrite existing properties #717

@kwin

Description

@kwin

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 {
).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions