OpenLiberty / ci.maven

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

Detect installation directory changes when `dev` mode is running and handle it somehow #1794

Closed cherylking closed 9 months ago

cherylking commented 9 months ago

This is related to issue 878 scenario 2. According to that issue, this plugin handles a change in the installation directory while dev mode is running. When I tested that scenario, I found that dev mode does detect the change and calls the create goal which then updates the values in liberty-plugin-config.xml. However, dev mode did not stop the server that was running on the existing installation, nor did it start the server in the newly referenced installation.

After discussing with the development team, it was decided the best option is to detect the change and issue a warning that it will not take affect until the next invocation of the dev goal. This would require keeping the old settings in the current Project, which I am not sure is possible. What if there were other changes in the pom.xml besides the installation location?

Another option would be to detect the change and throw an error and stop dev mode, instructing the user that a change in installation location requires dev mode to be restarted.

Changes needed:

  1. Detect each change to pom.xml that affects installation directory (installDirectory, runtimeInstallDirectory).
  2. What about userDirectory, outputDirectory and serverName? Those affect parts of the installation as well.
  3. Issue warning or throw error when one of those configuration parameters changes.
  4. If issue a warning, do not update the running dev mode with the new values from those configuration parameters and do not call create goal.