0

Not able to find the sensitive .properties file path, when I run the jar, but from IDE it is executing, using Gradle. sensitive. properties is in the resources folder

public void getConfigValue(String configKey) {
        Resource resource = new ClassPathResource("sensitive.properties");
        
        String value = null;
        try {
            LOGGER.info("FilePath :" + resource.getURI().getPath());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

Command used to run the jar:

java -jar -Dspring.profiles.active=test1 myservice.jar
Girish
  • 2,196
  • 2
  • 18
  • 24

0 Answers0