Improve the error message when additional build-info prop has null value
Closes gh-6724
This commit is contained in:
@@ -28,6 +28,7 @@ import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
|
||||
import org.springframework.boot.loader.tools.BuildPropertiesWriter;
|
||||
import org.springframework.boot.loader.tools.BuildPropertiesWriter.NullAdditionalPropertyValueException;
|
||||
import org.springframework.boot.loader.tools.BuildPropertiesWriter.ProjectDetails;
|
||||
|
||||
/**
|
||||
@@ -53,8 +54,8 @@ public class BuildInfoMojo extends AbstractMojo {
|
||||
private File outputFile;
|
||||
|
||||
/**
|
||||
* Additional properties to store in the build-info.properties. Each entry is prefixed by
|
||||
* {@code build.} in the generated build-info.properties.
|
||||
* Additional properties to store in the build-info.properties. Each entry is prefixed
|
||||
* by {@code build.} in the generated build-info.properties.
|
||||
*/
|
||||
@Parameter
|
||||
private Map<String, String> additionalProperties;
|
||||
@@ -67,6 +68,10 @@ public class BuildInfoMojo extends AbstractMojo {
|
||||
this.project.getArtifactId(), this.project.getVersion(),
|
||||
this.project.getName(), this.additionalProperties));
|
||||
}
|
||||
catch (NullAdditionalPropertyValueException ex) {
|
||||
throw new MojoFailureException(
|
||||
"Failed to generated build-info.properties. " + ex.getMessage(), ex);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new MojoExecutionException(ex.getMessage(), ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user