I am aware of the various JMix and Spring Properties
classes and how to inject them. But I am wondering how I could make my own Properties class. I’ve attempted on my own by copying an existing class, without success. I figure I am missing some nuance so any advice would be appreciated.
This is the class I attempted with, for reference:
package com.company.deiproductconfig2.core;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConstructorBinding;
import org.springframework.boot.context.properties.bind.DefaultValue;
@ConfigurationProperties(prefix = "aspen")
@ConstructorBinding
public class AspenProperties {
String buildDate;
public AspenProperties(
@DefaultValue("-UNKNOWN BUILD DATE-") String buildDate) {
this.buildDate = buildDate;
}
public String getBuildDate(){
return this.buildDate;
}
}