Add build-info skip support

See gh-34393
This commit is contained in:
Diego Díez 2023-02-27 15:58:06 +01:00 committed by Moritz Halbritter
parent a7f2be8b14
commit b073ef0310
1 changed files with 10 additions and 0 deletions

View File

@ -97,8 +97,18 @@ public class BuildInfoMojo extends AbstractMojo {
@Parameter
private List<String> excludeInfoProperties;
/**
* Skip the execution.
*/
@Parameter(property = "spring-boot.build-info.skip", defaultValue = "false")
private boolean skip;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (this.skip) {
getLog().debug("skipping build-info as per configuration.");
return;
}
try {
ProjectDetails details = getProjectDetails();
new BuildPropertiesWriter(this.outputFile).writeBuildProperties(details);