Add additionalOptions parameter to pass additional options to Antora
In certain circumstances, such as when working on the docs, a user may want to pass additional options to the Antora command that augment or override the options defined in the POM file. The way the Maven plugin system works, the value of a user property mapped to a parameter (e.g., antora.options
) does not override the value defined in the POM file. And even the plugin were implemented in such a way as to invert that behavior, the options defined in the user property would end up replacing all the option defined in the POM, not just appending to them. For these reasons, a separate parameter is warranted.
The additionalOptions parameter would be defined and processed in the same was as the options parameter. The difference is that the options defined using the additionalOptions parameter would be appended to any options already collected. For example:
mvn antora -Dantora.additionalOptions=--log-level=info
If the additionalOptions parameter defines an option with the same name as an existing option, it would update the value of that option.
There's an assumption that the additionalOptions parameter would never be defined in the POM file itself. Rather, it is intended for command line use.
As part of this issue, the existing options parameter should be mapped to the antora.options user property. It's unlikely to be used as it will not override the value defined in the POM file, but it could still prove useful.