Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to update liberty-plugin-config.xml during Dev Mode startup and after build file changes #878

Closed
dessina-devasia opened this issue Feb 6, 2024 · 2 comments · Fixed by #880
Assignees

Comments

@dessina-devasia
Copy link

Upon starting dev mode, the liberty-plugin-config.xml file does not reflect updates if the file pre-exists. Specifically, changes made to the installDir value within the build.gradle file are not being synchronised into the liberty-plugin-config.xml file. The same behaviour is observed when the installDir value is updated in the build.gradle while dev mode is running. The LMP works as expected in both scenarios, ie. the installDir value is updated in liberty-plugin-config.xml both at startup and while dev mode is running.

Scenario 1

Prerequisites:

  • The testing environment is the liberty.gradle.test.wrapper.app project, located at liberty-tools-vscode/src/test/resources/gradle.
  • The project should already include a liberty-plugin-config.xml file.

Steps to Reproduce:

  1. In the build.gradle file, incorporate a custom installDir value. For example, change the installDirectory by adding the following block:
    ext { liberty.installDir = "/Users/dessina/Documents/Workspace/IntelliJ/guide-getting-started/start/myinstalldir/wlp" }
  2. Start the liberty server.
  3. Observe that the value within the liberty-plugin-config.xml file remains unchanged, disregarding the new value specified in build.gradle.

Scenario 2

Prerequisites:
Test environment is set up in the liberty.gradle.test.wrapper.app project, located under liberty-tools-vscode/src/test/resources/gradle.

Steps to Reproduce:

  1. Perform a project clean operation using the command gradle clean.
  2. Start liberty server with the default build.gradle file without modifying any configuration.
  3. Modify the build.gradle file by adding a custom configuration. For example, change the installDirectory by adding the following block:
    ext { liberty.installDir = "/Users/dessina/Documents/Workspace/IntelliJ/guide-getting-started/start/myinstalldir/wlp" }
  4. Verify the value in the liberty-plugin-config.xml file.
  5. Observe that the value is not updated to the new path, indicating an issue with the live update functionality.
@cherylking cherylking self-assigned this Feb 6, 2024
@cherylking
Copy link
Member

@dessina-devasia Just wanted to note here that the Maven plugin is not actually handling scenario 2 correctly. You are right that it updated the liberty-plugin-config.xml, but it did not stop the server that was running on the old installation nor did it start the server running on the new installation. I really don't think dev mode should try to handle scenario 2 and should just throw an error and stop dev mode instead. I will bring this up at the next DI call.

@cherylking
Copy link
Member

Scenario 1 should be fixed with PR #879. Will leave this issue open to address scenario 2. Right now I am leaning towards detecting a change in installDir and throwing an error, explaining to the end user that they must restart dev mode because of the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants