Open OndraZizka opened 5 years ago
I had this happen to me as well. I fixed it, by moving away from external to docker.imagePropertyConfiguration = override in my top level pom, and docker.imagePropertyConfiguration = skip in the pom where I am setting some image build information such as name, tags, and contextDir.
I take this back.. setting the override in my top level pom ignored my Dockerfiles and completely broke my images
There's a fix merged in recently which should solve this issue. Could you please try whether a d-m-p built from master does fix it for you ?
I can try when I get to dmp again, which will be in around few weeks. If that's ok.
I can try when I get to dmp again, which will be in around few weeks. If that's ok.
No worries. We will have then probably already the next release, to you can directly test on a released version then.
Same here with exact same version under Windows 10:
Caused by: java.lang.NullPointerException
at io.fabric8.maven.docker.config.handler.property.PropertyConfigHandler.extractBuildConfiguration (PropertyConfigHandler.java:140)
at io.fabric8.maven.docker.config.handler.property.PropertyConfigHandler.resolve (PropertyConfigHandler.java:73)
at io.fabric8.maven.docker.config.handler.ImageConfigResolver.resolve (ImageConfigResolver.java:98)
at io.fabric8.maven.docker.AbstractDockerMojo$1.resolve (AbstractDockerMojo.java:331)
at io.fabric8.maven.docker.config.ConfigHelper.resolveConfiguration (ConfigHelper.java:159)
at io.fabric8.maven.docker.config.ConfigHelper.resolveImages (ConfigHelper.java:57)
at io.fabric8.maven.docker.AbstractDockerMojo.initImageConfiguration (AbstractDockerMojo.java:325)
at io.fabric8.maven.docker.AbstractDockerMojo.execute (AbstractDockerMojo.java:224)
<image>
<alias>app</alias>
<name>foo/bar:latest</name>
<build>
<dockerFile>${project.build.directory}/work/docker/Dockerfile</dockerFile>
<imagePullPolicy>Always</imagePullPolicy>
</build>
<external>
<type>properties</type>
<prefix>docker</prefix>
<mode>override</mode>
</external>
<run>
<ports>
<port>docker.test.proxy.port:8443</port>
</ports>
<env>
<ENABLE_DEBUG>true</ENABLE_DEBUG>
</env>
<wait>
<http>
<url>${docker.test.url}</url>
<method>GET</method>
<status>200</status>
</http>
<time>${docker.test.start.timout}</time>
</wait>
<log>
<enabled>true</enabled>
<color>cyan</color>
</log>
</run>
</image>
There's a fix merged in recently which should solve this issue. Could you please try whether a d-m-p built from master does fix it for you ?
Can you please link the corresponding issue or commit fix? Thanks.
==> I think it's this one: https://github.com/fabric8io/docker-maven-plugin/issues/1274
@svenhaag : Are you able to reproduce this error on a SNAPSHOT build of master of this plugin?
@svenhaag : Are you able to reproduce this error on a SNAPSHOT build of master of this plugin?
Yeah, indeed it works as expected. Thanks!
@svenhaag : cool, it would be released soon
Let's plan a release for the weekend.
Description
When using
<external>
, DMP throws a NPE. Following the docs at https://dmp.fabric8.io/#combining-property-config .Info
mvn -v
) : Maven home: /sw/prog/maven-3.6.0 Java version: 12.0.1, vendor: Oracle Corporation, runtime: /sw/prog/jdk/12.0.1 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.15.0-55-generic", arch: "amd64", family: "unix"...
Caused by: java.lang.NullPointerException at io.fabric8.maven.docker.config.handler.property.PropertyConfigHandler.extractBuildConfiguration (PropertyConfigHandler.java:136) at io.fabric8.maven.docker.config.handler.property.PropertyConfigHandler.resolve (PropertyConfigHandler.java:73) at io.fabric8.maven.docker.config.handler.ImageConfigResolver.resolve (ImageConfigResolver.java:98) at io.fabric8.maven.docker.AbstractDockerMojo$1.resolve (AbstractDockerMojo.java:331) at io.fabric8.maven.docker.config.ConfigHelper.resolveConfiguration (ConfigHelper.java:159) at io.fabric8.maven.docker.config.ConfigHelper.resolveImages (ConfigHelper.java:57) at io.fabric8.maven.docker.AbstractDockerMojo.initImageConfiguration (AbstractDockerMojo.java:325) at io.fabric8.maven.docker.AbstractDockerMojo.execute (AbstractDockerMojo.java:224) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:567) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)