Skip to content

Conversation

@trask
Copy link
Member

@trask trask commented Dec 19, 2024

Resolves #3989

@jeanbisutti
Copy link
Member

Spring Boot can also retrieve configuration files in the /config subdirectory of the current directory: https://docs.spring.io/spring-boot/docs/2.0.x/reference/html/boot-features-external-config.html#boot-features-external-config-application-property-files

The Application Insights json file could also be retrieved from this subdirectory.

try {
return Files.newInputStream(defaultFile.toPath());
} catch (IOException e) {
throw new IllegalStateException(
Copy link
Member

Choose a reason for hiding this comment

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

try {
Optional<String> jsonConfig = findJsonConfig();
Optional<String> jsonConfig = findJsonConfigFromClasspath();
if (!jsonConfig.isPresent()) {
Copy link
Member

Choose a reason for hiding this comment

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

Let's assume the user adds a JSON configuration file in src/main/resources and creates a Spring Boot executable JAR.

The user may want to use a configuration different from the default one in the classpath without creating a new JAR file.

It may be useful to check the configuration from the file system first.

@trask trask merged commit e01bd32 into main Jan 9, 2025
90 checks passed
@trask trask deleted the runtime-attach-curr-dir branch January 9, 2025 16:26
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.

Feature Request: Support for Loading applicationinsights.json from Current Working Directory (CWD)

3 participants