Why am I getting default Spring profile when using sbt-assembly and passing the profile?

60 Views Asked by At

I have a simple Scala project I compile with sbt-assembly. When I get the jar and try to run like this

java -jar -Dspring.profiles.active=private target/scala-3.2.2/CalBackend-assembly-0.0.1-SNAPSHOT.jar

I get

INFO: No active profile set, falling back to 1 default profile: "default"

I have tried other itterations...

java -jar target/scala-3.2.2/CalBackend-assembly-0.0.1-SNAPSHOT.jar --spring.profiles.active=private                                 
SPRING_PROFILES_ACTIVE=private java -jar target/scala-3.2.2/CalBackend-assembly-0.0.1-SNAPSHOT.jar 

But I always get the same. What am I missing?

When building with SBT this works fine

SPRING_PROFILES_ACTIVE=private sbt \~run
0

There are 0 best solutions below