jfrog / artifactory-maven-plugin

A Maven plugin to resolve artifacts from Artifactory, deploy artifacts to Artifactory, capture and publish build info.
https://www.jfrog.com/confluence/display/JFROG/Maven+Artifactory+Plugin
Apache License 2.0
24 stars 26 forks source link

NullPointerException in v3.6.0 with no proxy config #66

Closed peteyoungs closed 1 year ago

peteyoungs commented 1 year ago

Describe the bug

Several of our builds are failing since the release of version 3.6.0 with message NullPointerException We do not fix the plugin version in our poms so the builds automatically use the latest version This appears to be due to the introduction of the proxy configuration in the plugin

Current behavior

Build fails with this error

09:50:21  [ERROR] Failed to execute goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish (build-info) on project root: Execution build-info of goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish failed. NullPointerException -> [Help 1]

Running with mvn -X reveals the stack trace

11:31:38  [INFO] ------------------------------------------------------------------------
11:31:38  [INFO] BUILD FAILURE
11:31:38  [INFO] ------------------------------------------------------------------------
11:31:38  [INFO] Total time:  3.560 s
11:31:38  [INFO] Finished at: 2023-04-03T09:31:38Z    11:31:38  [INFO] Finished at: 2023-04-03T09:31:38Z
11:31:38  [INFO] ------------------------------------------------------------------------
11:31:38  [ERROR] Failed to execute goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish (build-info) on project root: Execution build-info of goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish failed. NullPointerException -> [Help 1]
11:31:38  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish (build-info) on project root: Execution build-info of goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish failed.
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
11:31:38      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
11:31:38      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
11:31:38      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
11:31:38      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
11:31:38      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
11:31:38      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
11:31:38      at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
11:31:38      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
11:31:38      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
11:31:38      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
11:31:38      at java.lang.reflect.Method.invoke (Method.java:498)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
11:31:38  Caused by: org.apache.maven.plugin.PluginExecutionException: Execution build-info of goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish failed.
11:31:38      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
11:31:38      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
11:31:38      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
11:31:38      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
11:31:38      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
11:31:38      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
11:31:38      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
11:31:38      at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
11:31:38      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
11:31:38      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
11:31:38      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
11:31:38      at java.lang.reflect.Method.invoke (Method.java:498)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
11:31:38  Caused by: java.lang.NullPointerException
11:31:38      at org.jfrog.buildinfo.ArtifactoryMojo.setupProxy (ArtifactoryMojo.java:94)
11:31:38      at org.jfrog.buildinfo.ArtifactoryMojo.execute (ArtifactoryMojo.java:72)
11:31:38      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
11:31:38      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
11:31:38      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
11:31:38      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
11:31:38      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
11:31:38      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
11:31:38      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
11:31:38      at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
11:31:38      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
11:31:38      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
11:31:38      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
11:31:38      at java.lang.reflect.Method.invoke (Method.java:498)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
11:31:38  [ERROR] 
11:31:38  [ERROR] 
11:31:38  [ERROR] For more information about the errors and possible solutions, please read the following articles:
11:31:38  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Reproduction steps

Ensure that the user maven settings.xml does not contain any proxy settings Create a new maven project (e.g. using the quickstart archetype command here) Execute the plugin from the project directory mvn org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish The build fails with message NullPointerException

Expected behavior

The build should complete succesfully, as it does with version 3.5.1

Artifactory Maven plugin version

3.6.0

Operating system type and version

Windows 10

JFrog Artifactory version

No response

Maven version

3.8.3

yahavi commented 1 year ago

@peteyoungs Thanks for reporting this issue. We released Maven Artifactory plugin v3.6.1 to fix it. The fix is expected to be available in Maven Central in a few hours. Feel free to upgrade - we'd appreciate your feedback on that.

peteyoungs commented 1 year ago

Hi @yahavi, the problem is fixed. Thanks for the quick turnaround

yahavi commented 1 year ago

@peteyoungs Thanks for your feedback and for providing the stack trace which helped us to resolve this issue quickly. I'm glad to hear that it works for you now.