I am trying to get value from a property file on spring boot. application.properties file is under resources folder, and its content;
TEST=someText
And the code is;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.PropertySource;
@SpringBootApplication
@PropertySource("classpath:application.properties")
public class Bb8Application {
@Value("${TEST}")
static String someString;
public static void main(String[] args) {
System.out.print(someString);
}
}
I get NULL as a result instead of "someText". Is there something that I am missing?