When I try to set a custom builder in the maven plugin by following the documentation: https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/html/#build-image-example-custom-image-builder

Like this:

      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
          <image>
            <builder>gcr.io/paketo-buildpacks/bellsoft-liberica</builder>
          </image>
        </configuration>
      </plugin>

Running ./mvnw spring-boot:build-image fails with the following exception:

Caused by: java.lang.NullPointerException
    at org.springframework.boot.buildpack.platform.docker.type.ImageConfig.parseConfigEnv (ImageConfig.java:52)
    at org.springframework.boot.buildpack.platform.docker.type.ImageConfig.<init> (ImageConfig.java:46)
    at org.springframework.boot.buildpack.platform.docker.type.Image.<init> (Image.java:51)
    at org.springframework.boot.buildpack.platform.json.MappedObject.of (MappedObject.java:148)
    at org.springframework.boot.buildpack.platform.json.MappedObject.of (MappedObject.java:131)
    at org.springframework.boot.buildpack.platform.docker.type.Image.of (Image.java:111)
    at org.springframework.boot.buildpack.platform.docker.DockerApi$ImageApi.pull (DockerApi.java:163)
    at org.springframework.boot.buildpack.platform.build.Builder.pullBuilder (Builder.java:85)
    at org.springframework.boot.buildpack.platform.build.Builder.build (Builder.java:63)
    at org.springframework.boot.maven.BuildImageMojo.buildImage (BuildImageMojo.java:136)
    at org.springframework.boot.maven.BuildImageMojo.execute (BuildImageMojo.java:128)

I made this project to reproduce the error: https://github.com/jcfandino/spring-boot-npe You can look at the build pipeline to see the error: https://github.com/jcfandino/spring-boot-npe/actions

Comment From: wilkinsona

Thanks for the sample, @jcfandino. The cause of the problem is that you are specifying gcr.io/paketo-buildpacks/bellsoft-liberica as a builder when it is an individual buildpack. As a result, the JSON that describes the image does not contain some information that is expected to be there. We don't handle this gracefully which results in the NPE. We need to improve the error handling here.

Comment From: jcfandino

I see. Thanks for the quick response.