Search in sources :

Example 1 with BuildPropertiesWriter

use of org.springframework.boot.loader.tools.BuildPropertiesWriter in project spring-boot by spring-projects.

the class BuildInfoMojo method execute.

@Override
public void execute() throws MojoExecutionException, MojoFailureException {
    try {
        new BuildPropertiesWriter(this.outputFile).writeBuildProperties(new ProjectDetails(this.project.getGroupId(), this.project.getArtifactId(), this.project.getVersion(), this.project.getName(), this.additionalProperties));
        this.buildContext.refresh(this.outputFile);
    } catch (NullAdditionalPropertyValueException ex) {
        throw new MojoFailureException("Failed to generate build-info.properties. " + ex.getMessage(), ex);
    } catch (Exception ex) {
        throw new MojoExecutionException(ex.getMessage(), ex);
    }
}
Also used : ProjectDetails(org.springframework.boot.loader.tools.BuildPropertiesWriter.ProjectDetails) NullAdditionalPropertyValueException(org.springframework.boot.loader.tools.BuildPropertiesWriter.NullAdditionalPropertyValueException) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) MojoFailureException(org.apache.maven.plugin.MojoFailureException) BuildPropertiesWriter(org.springframework.boot.loader.tools.BuildPropertiesWriter) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) MojoFailureException(org.apache.maven.plugin.MojoFailureException) NullAdditionalPropertyValueException(org.springframework.boot.loader.tools.BuildPropertiesWriter.NullAdditionalPropertyValueException)

Aggregations

MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 MojoFailureException (org.apache.maven.plugin.MojoFailureException)1 BuildPropertiesWriter (org.springframework.boot.loader.tools.BuildPropertiesWriter)1 NullAdditionalPropertyValueException (org.springframework.boot.loader.tools.BuildPropertiesWriter.NullAdditionalPropertyValueException)1 ProjectDetails (org.springframework.boot.loader.tools.BuildPropertiesWriter.ProjectDetails)1