ERROR: Build step failed with exception
net.sf.json.JSONException: null object
at net.sf.json.JSONObject.verifyIsNull(JSONObject.java:2688)
at net.sf.json.JSONObject.element(JSONObject.java:1733)
at net.sf.json.JSONObject.element(JSONObject.java:1716)
at net.sf.json.JSONObject.put(JSONObject.java:2328)
at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryToken$1.call(DockerRegistryToken.java:154)
at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryToken$1.call(DockerRegistryToken.java:129)
at hudson.remoting.LocalChannel.call(LocalChannel.java:47)
at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryToken.newKeyMaterialFactory(DockerRegistryToken.java:129)
at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:273)
at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:258)
at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:250)
at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(DockerBuilder.java:457)
at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(DockerBuilder.java:431)
at com.cloudbees.dockerpublish.DockerBuilder$Perform.buildAndTag(DockerBuilder.java:373)
at com.cloudbees.dockerpublish.DockerBuilder$Perform.exec(DockerBuilder.java:311)
at com.cloudbees.dockerpublish.DockerBuilder$Perform.access$100(DockerBuilder.java:291)
at com.cloudbees.dockerpublish.DockerBuilder.perform(DockerBuilder.java:262)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:164)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526)
at hudson.model.Run.execute(Run.java:1900)
There is not much we can help with. You might want to post this in a Jenkins forum, where it’s more likely to find others that use maven to build their images the way you try to do.
A quick search on Google like “jenkins net.sf.json.JSONException: null object” can also give you an idea what is happening. It clearly indicates a json error in Jenkins and probably has nothing to do with Docker. Example