[Bug] Watch the wrong application.properties file when starting up the nacos server
Describe the bug
When staging up the nacos server, registerWatcher would be invoked. However, the file being watched is /home/user/nacos/conf/application.properties, and the file and properties being reloaded in the onChange method is classpath/application.properties or ${spring.config.additional-location}/application.properties. It's inconsistent.
Expected behavior
The file being watched and the file being reloaded should be the same, which should be classpath/application.properties or ${spring.config.additional-location}/application.properties.
Actually behavior
Currently, the file being watched is /home/user/nacos/conf/application.properties, and the file and properties being reloaded in the onChange method is classpath/application.properties or ${spring.config.additional-location}/application.properties.
How to Reproduce Steps to reproduce the behavior:
- Go to 'com.alibaba.nacos.core.listener.StartingApplicationListener#registerWatcher'
- Check the following code:
Desktop (please complete the following information):
- OS: macos
- Version 2.4.1
Additional context Add any other context about the problem here.