Polish "Allow build info properties to be excluded"

Update the Maven plugin to use an alternative syntax to exclude
the info properties and apply some minor polishing.

See gh-27412
This commit is contained in:
Phillip Webb
2021-10-13 14:04:13 -07:00
parent ea9faf8690
commit f4bd8956af
8 changed files with 86 additions and 98 deletions

View File

@@ -59,10 +59,11 @@ public class BuildInfo extends ConventionTask {
@TaskAction
public void generateBuildProperties() {
try {
ProjectDetails details = new ProjectDetails(this.properties.getGroup(), this.properties.getArtifact(),
this.properties.getVersion(), this.properties.getName(), this.properties.getTime(),
coerceToStringValues(this.properties.getAdditional()));
new BuildPropertiesWriter(new File(getDestinationDir(), "build-info.properties"))
.writeBuildProperties(new ProjectDetails(this.properties.getGroup(), this.properties.getArtifact(),
this.properties.getVersion(), this.properties.getName(), this.properties.getTime(),
coerceToStringValues(this.properties.getAdditional())));
.writeBuildProperties(details);
}
catch (IOException ex) {
throw new TaskExecutionException(this, ex);