Maven plugins for managing Liberty profile servers #devops
Apache License 2.0
126
stars
90
forks
source link
In liberty:create goal, liberty-plugin-config.xml doesn't reflect precedence of liberty.bootstrap.* props over <bootstrapPropertiesFile> plugin config #1788
both the 'create' and 'deploy' goals will generate a 'bootstrap.properties' file from the liberty.bootstrap.name property. The <bootstrapPropertiesFile> config will be ignored.
However, if you look at the liberty-plugin-config.xml, the 'deploy' goal will write the correct, individual property, matching the generated 'bootstrap.properties' file:
The reason seems to be that the precedence incorporating the liberty.bootstrap.* project props is encoded in the io.openliberty.tools.maven.server.StartDebugMojoSupport.copyConfigFiles() method, which gets called BEFORE the liberty-plugin-config.xml is written in the 'deploy' goal, but only gets called AFTER the plugin config is written in the 'create' goal.
From the doc, https://github.com/OpenLiberty/ci.maven/blob/main/docs/common-server-parameters.md, it doesn't specifically mention the liberty.bootstrap.* project props but it does say that plugin config parm <bootstrapProperties> takes precedence over <bootstrapPropertiesFile>, so the generated properties seem correct and the plugin cfg xml seems wrong.
In dev mode, a create then a deploy is typically done, so the practical impact of this may be almost zero today.
But as Liberty Tools (IDE support) adds more usage of the liberty-plugin-config.xml maybe this should be fixed.
I know this is a long writeup for possibly a 1-line change of writing the plugin cfg maybe after copyConfigFiles in the create goal... but wanted to make sure we understood clearly first :)
Using v3.10, with pom.xml property and plugin config like:
both the 'create' and 'deploy' goals will generate a 'bootstrap.properties' file from the liberty.bootstrap.name property. The
<bootstrapPropertiesFile>
config will be ignored.However, if you look at the liberty-plugin-config.xml, the 'deploy' goal will write the correct, individual property, matching the generated 'bootstrap.properties' file:
while the 'create' goal will write:
The reason seems to be that the precedence incorporating the liberty.bootstrap.* project props is encoded in the
io.openliberty.tools.maven.server.StartDebugMojoSupport.copyConfigFiles()
method, which gets called BEFORE the liberty-plugin-config.xml is written in the 'deploy' goal, but only gets called AFTER the plugin config is written in the 'create' goal.From the doc, https://github.com/OpenLiberty/ci.maven/blob/main/docs/common-server-parameters.md, it doesn't specifically mention the liberty.bootstrap.* project props but it does say that plugin config parm
<bootstrapProperties>
takes precedence over<bootstrapPropertiesFile>
, so the generated properties seem correct and the plugin cfg xml seems wrong.In dev mode, a create then a deploy is typically done, so the practical impact of this may be almost zero today.
But as Liberty Tools (IDE support) adds more usage of the liberty-plugin-config.xml maybe this should be fixed.
I know this is a long writeup for possibly a 1-line change of writing the plugin cfg maybe after copyConfigFiles in the create goal... but wanted to make sure we understood clearly first :)