5

While running command

mvn -X clean deploy

I am getting following error

        [INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ something ---
    [DEBUG] [buildinfo] Resolved artifact: org.apache.maven.plugins:maven-deploy-plugin:pom:2.7:build from: team (http://myrepo/maven/m2repos, releases+snapshots) Context is: plugin
    [DEBUG] [buildinfo] Resolved artifact: org.apache.maven.plugins:maven-deploy-plugin:jar:2.7:build from: team (http://myrepo/maven/m2repos, releases+snapshots) Context is: plugin
    [DEBUG] [buildinfo] Resolved artifact: junit:junit:jar:3.8.1:build from: C:\Users\user\.m2\repository (enhanced) Context is: plugin
    [DEBUG] [buildinfo] Resolved artifact: org.codehaus.plexus:plexus-utils:jar:1.5.6:build from: C:\Users\user\.m2\repository (enhanced) Context is: plugin
    [INFO] Uploading: scp://myrepo/export/maven/m2repos/com/team/myproject/10.8/myproject-10.8.war
    [INFO] Uploaded: scp://myrepo/export/maven/m2repos/com/team/myproject/10.8/myproject-10.8.war (162384 KB at 23020.0 KB/sec)
    [INFO] Uploading: scp://myrepo/export/maven/m2repos/com/team/myproject/10.8/myproject-10.8.pom
    [INFO] Uploaded: scp://myrepo/export/maven/m2repos/com/team/myproject/10.8/myproject-10.8.pom (46 KB at 27.3 KB/sec)
    [INFO] Downloading: scp://myrepo/export/maven/m2repos/com/team/myproject/maven-metadata.xml
    [INFO] Downloaded: scp://myrepo/export/maven/m2repos/com/team/myproject/maven-metadata.xml (19 KB at 162.1 KB/sec)
    [INFO] Uploading: scp://myrepo/export/maven/m2repos/com/team/myproject/maven-metadata.xml
    [INFO] Uploaded: scp://myrepo/export/maven/m2repos/com/team/myproject/maven-metadata.xml (19 KB at 12.6 KB/sec)
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 9:07.223s
    [INFO] Finished at: Thu Apr 27 21:40:53 PDT 2017
    [INFO] Final Memory: 54M/568M
    [INFO] ------------------------------------------------------------------------
    Waiting for Jenkins to finish collecting data
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project myproject: Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed. NullPointerException -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project myproject: Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
        at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
        at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:185)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at hudson.maven.Maven3Builder.call(Maven3Builder.java:136)
        at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
        at hudson.remoting.UserRequest.perform(UserRequest.java:153)
        at hudson.remoting.UserRequest.perform(UserRequest.java:50)
        at hudson.remoting.Request$2.run(Request.java:332)
        at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed.
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:115)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 30 more
    Caused by: java.lang.NullPointerException
        at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:178)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
        ... 31 more
    [ERROR] 
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

If i look at my maven repo, all files are already uploaded with build as seen in log (it says uploaded for files), But at last build status failed with nullpointer exception. I have no clue even after enabling debug mode. Any help please.

5
  • The weird thing about this is that line 178 of org.apache.maven.plugin.deploy.DeployMojo contains just { and nothing within cooee of it could possibly NPE. Commented Apr 28, 2017 at 5:26
  • Which version of Maven do you use? Which JDK Version do you use? Why are you using scp based repository and not http like? Why not using an uptodate version of maven-deploy-plugin (currently 3.0.0)..? Have you correctly configured to use wagon-provider in your pom as extensions apart from that using an uptodate version of wagon? BTW: Please show your pom.xml file Commented Apr 28, 2017 at 6:23
  • @Steve C, Sorry did not get you. Commented Apr 28, 2017 at 9:04
  • @khmarbaise I am using maven 3.1.1, java 1.8 maven-deploy-plugin is being used for long time. The weird part is this build did not throw error before but started throwing recently. Commented Apr 28, 2017 at 9:10
  • I am facing the exact issue when I am building my maven job on jenkins. Were you able to fix this ? Commented Feb 6, 2019 at 17:14

1 Answer 1

2

Upgrading to recent version of maven-deploy-plugin solved the issue for me.

E.g.:

<build>
    <plugins>
        <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>3.0.0-M1</version>
        </plugin>
    </plugins>
</build>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.