When passing in the spring.config.import property like so:

mvn exec:java -Dexec.mainClass="<main class> -Dspring.config.import='optional:configserver:http://myconfigserver.com'

I get the error

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java (default-cli) on project microservice: An exception occured while executing the Java class. Unable to load config data from 'optional:configserver:http://myconfigserver.com': File extension is not known to any PropertySourceLoader. If the location is meant to reference a directory, it must end in '/' or File.separator -> [Help 1]

The same error occurs when deploying the app via a Helm chart or when using the Intellij runner.

I am currently on Spring Boot 2.5.2 and Spring Cloud 2020.0.3, although this issue has occurred on a variety of version combinations. I believe I have followed the docs here: https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#_client_side_usage

What else can I try?

Comment From: ryanjbaxter

If you put the same property in application.properties do you get the same error?