GoogleContainerTools / jib

🏗 Build container images for your Java applications.
Apache License 2.0
13.71k stars 1.44k forks source link

Jib does not provide meaningful exception message jib:build #4263

Open shershen0 opened 6 months ago

shershen0 commented 6 months ago

Environment:

Description of the issue: Got exception during jib:build plugin job, and exception does not represent meaningful output, since it says that map value is null, but does not specify the key

labels map contains null values

Expected behavior: Output message like this:

labels map contains null values for key {//key name//}

Steps to reproduce:

  1. mvn clean -U install

jib-maven-plugin Configuration:

    <plugin>
        <groupId>com.google.cloud.tools</groupId>
        <artifactId>jib-maven-plugin</artifactId>
        <configuration>
            <extraDirectories>
                <paths>
                    <path>
                        <from>target/mosek</from>
                        <into>/deployments/mosek</into>
                    </path>
                    <path>
                        <from>../mosek</from>
                        <into>/deployments/mosek</into>
                        <includes>mosek.lic</includes>
                    </path>
                </paths>
                <permissions>
                    <permission>
                        <file>/deployments/mosek</file>
                        <mode>755</mode>
                    </permission>
                    <permission>
                        <file>/deployments/mosek/*</file>
                        <mode>755</mode>
                    </permission>
                </permissions>
            </extraDirectories>
        </configuration>
    </plugin>

Log output: Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.3.1:build (default) on project tradefinance-optimizer: Execution default of goal com.google.cloud.tools:jib-maven-plugin:3.3.1:build failed: labels map contains null values

Full exception trace:

[16:09:19] : [Step 10/15] Caused by: java.lang.IllegalArgumentException: labels map contains null values [16:09:19] : [Step 10/15] at com.google.common.base.Preconditions.checkArgument (Preconditions.java:145) [16:09:19] : [Step 10/15] at com.google.cloud.tools.jib.configuration.ContainerConfiguration$Builder.setLabels (ContainerConfiguration.java:241) [16:09:19] : [Step 10/15] at com.google.cloud.tools.jib.api.JibContainerBuilder.setLabels (JibContainerBuilder.java:462) [16:09:19] : [Step 10/15] at com.google.cloud.tools.jib.plugins.common.PluginConfigurationProcessor.processCommonConfiguration (PluginConfigurationProcessor.java:441) [16:09:19] : [Step 10/15] at com.google.cloud.tools.jib.plugins.common.PluginConfigurationProcessor.processCommonConfiguration (PluginConfigurationProcessor.java:490) [16:09:19] : [Step 10/15] at com.google.cloud.tools.jib.plugins.common.PluginConfigurationProcessor.createJibBuildRunnerForRegistryImage (PluginConfigurationProcessor.java:309) [16:09:19] : [Step 10/15] at com.google.cloud.tools.jib.maven.BuildImageMojo.execute (BuildImageMojo.java:110) [16:09:19] : [Step 10/15] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) [16:09:19] : [Step 10/15] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) [16:09:19] : [Step 10/15] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) [16:09:19] : [Step 10/15] at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) [16:09:19] : [Step 10/15] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) [16:09:19] : [Step 10/15] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) [16:09:19] : [Step 10/15] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) [16:09:19] : [Step 10/15] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) [16:09:19] : [Step 10/15] at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) [16:09:19] : [Step 10/15] at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) [16:09:19] : [Step 10/15] at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) [16:09:19] : [Step 10/15] at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) [16:09:19] : [Step 10/15] at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) [16:09:19] : [Step 10/15] at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) [16:09:19] : [Step 10/15] at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) [16:09:19] : [Step 10/15] at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) [16:09:19] : [Step 10/15] at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) [16:09:19] : [Step 10/15] at java.lang.reflect.Method.invoke (Method.java:498) [16:09:19] : [Step 10/15] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) [16:09:19] : [Step 10/15] at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) [16:09:19] : [Step 10/15] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) [16:09:19] : [Step 10/15] at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)