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

fix(ShepherdProperties): always load relative to catalina.home #505

Merged

Conversation

doinkythederp
Copy link
Contributor

@doinkythederp doinkythederp commented Apr 30, 2024

This PR updates ShepherdProperties.loadProperties to load paths relative to the Tomcat install rather than relative to the current working directory. While these are often the same, it is possible that the process will have an arbitrary current working directory, such as when running Tomcat manually or when using the macOS Homebrew service.

Fixes #504.

Changes

  • Uses System.getProperty("catalina.home") to get the Tomcat install path. This is more reliable than using the CWD.
  • The Java Path API is used for resolution.
  • I went ahead and fixed some warnings in the edited function and added documentation to it.
  • I've tested this on my Mac but I haven't checked if it works on Linux; I don't have any other computers running Tomcat.

@doinkythederp doinkythederp marked this pull request as ready for review April 30, 2024 04:33
@naknomum
Copy link
Member

naknomum commented May 2, 2024

works on linux with our dev/docker environment.

Copy link
Member

@naknomum naknomum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good and works on my local linux.

@TanyaStere42 TanyaStere42 merged commit 3a1088e into WildMeOrg:master May 2, 2024
1 check passed
@TanyaStere42 TanyaStere42 added this to the 10.2.0 milestone May 2, 2024
@TanyaStere42 TanyaStere42 removed this from the 10.2.0 milestone May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ShephardProperties does not always load properties from the correct path
3 participants