There is a good example in the documentation . You can automatically extend the properties of the Gradle project and refer to these properties as placeholders in the file application.properties.
processResources {
expand(project.properties)
}
You can then reference your Gradle project properties through placeholders, for example.
app.name=${name}
app.description=${description}
, , @Value, properties .
@Value("${app.version}")
public String appVersion;
@Override
public void run(String... arg0) throws Exception {
System.out.println(appVersion);
}
, :
Gradle s Groovy s SimpleTemplateEngine, ${..}. ${..} Spring . Spring Spring \${..}.
P.S.: maven . ...