OpenLiberty / ci.maven

Maven plugins for managing Liberty profile servers #devops
Apache License 2.0
130 stars 91 forks source link

Restart server when bootstrap.properties changes #702

Open ericglau opened 4 years ago

ericglau commented 4 years ago

When bootstrap.properties changes, e.g. the http port is changed, dev mode should restart the server.

Also ensure JVM options file and server.env file are tracked, and appropriate action is performed when they are updated so that the changes will take effect.

cherylking commented 4 years ago

Please note that there are four ways that bootstrap properties can change.

1) Update bootstrap.properties file in configDir 2) Update the file referenced by bootstrapPropertiesFile 3) Update inline bootstrpProperties in pom.xml 4) Add/remove/change a property with format liberty.bootstrap.*

Similar situation for jvm.options and server.env file as well.

TrevCraw commented 4 years ago
Scenario Behaviour Behaviour works as expected? Fix for this issue?
start with default file and modify default file server restarts and picks up new changes Yes Yes
start with custom file referenced in pom.xml and modify custom file server restarts and picks up new changes Yes Yes
start with inline properties in pom.xml and modify inline properties server restarts and picks up new changes Yes No, already worked as expected
start with default file while custom file reference exists in pom.xml, but the file does not, and modify default file ? ? No
start with default file and add custom file (custom file reference exists in pom.xml) print out message informing users they need to restart dev mode for changes to take effect Yes Yes
start with default file and add custom file and reference in pom.xml (either order) server restarts and picks up new changes if the custom file exists, however, the custom file is not registered No, custom file should be registered or a message should be displayed asking users to restart dev mode No
start with default file and add inline properties server restarts and picks up new inline changes - further changes to default file have no effect Yes No, already worked as expected
start with custom file and modify default file no restart (due to changes made), but default file is still copied to the target directory No, default file should not be copied No
start with custom file and add inline properties server restarts and picks up new inline changes - custom file modification does not affect prop values, but causes restart No, custom file changes should not cause restart Try
start with custom file and delete custom file restarts server and picks up default values, but the default file is not registered No, default file should be registered No
start with custom file and delete pom.xml reference to custom file restarts server and picks up default values, but the default file is not registered and the custom file is still tracked for changes No, default file should be registered and custom file unregistered No
start with custom file and change reference in pom.xml to point to another file restarts server and picks up changes from new file, but continues to track and react to changes from old file No, should not be tracking old file and should track the new one No
start with inline properties in pom.xml and modify default file no action taken Yes No, already worked as expected
start with inline properties in pom.xml and modify custom file (reference exists in pom.xml) no effect on values, but server restarts No, server should not restart Try
start with inline properties in pom.xml and delete the inline properties with a custom file setup server restarts, uses custom values, and continues to track custom file Yes Yes
start with inline properties in pom.xml and delete the inline properties with a default file setup server restarts, uses default values, and continues to track default file Yes Yes
ericglau commented 4 years ago

To summarize, support has been added for tracking file content changes in bootstrap properties and JVM options files. Server.env file content changes are not yet tracked, since dev mode needs to handle it differently to also insert the debug settings that it requires.

TrevCraw commented 4 years ago

New issue(s) will also be opened to handle all the scenarios that were not covered by this one.