I am trying to write a spring-boot app and I get a...
# announcements
c
I am trying to write a spring-boot app and I get a compile error about a constructor paramater needing to be a constant. And, technically, it is - it's a String. Can someone explain why it's not allowed to inject
@Value
with a SPeL statement?
Copy code
@SpringBootApplication
open class DeDup(@Value("#{new java.io.File('${roots}')}") val roots: Set<File>,
                 @Value("algo") val hashAlgo: String,
                 @Value("types")val fileTypes: List<String>) {

}

fun main(args: Array<String>) {
 SpringApplication.run(DeDup::class.java, *args)
}