【问题标题】:Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin deploy failed. NullPointerException目标 org.apache.maven.plugins:maven-deploy-plugin deploy 的执行 default-deploy 失败。空指针异常
【发布时间】:2017-04-28 05:00:11
【问题描述】:

运行命令时

mvn -X clean deploy

我收到以下错误

        [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

如果我查看我的 maven 存储库,所有文件都已上传,如日志中所示(它表示已上传文件),但最后构建状态因空指针异常而失败。即使启用调试模式,我也不知道。 请帮忙。

【问题讨论】:

  • 奇怪的是org.apache.maven.plugin.deploy.DeployMojo 的第178 行只包含{ 并且它的cooee 中没有任何内容可能是NPE。
  • 您使用哪个版本的 Maven?您使用哪个 JDK 版本?为什么您使用基于scp 的存储库而不是http 之类的?为什么不使用最新版本的 maven-deploy-plugin(当前为 3.0.0)..?除了使用最新版本的 wagon 之外,您是否正确配置为使用 wagon-provider in your pom as extensions?顺便说一句:请显示您的 pom.xml 文件
  • @Steve C,很抱歉没有找到你。
  • @khmarbaise 我正在使用 maven 3.1.1,java 1.8 maven-deploy-plugin 正在使用很长时间。奇怪的是这个构建之前没有抛出错误,但最近开始抛出。
  • 当我在 jenkins 上构建我的 maven 工作时,我正面临着确切的问题。你能解决这个问题吗?

标签: maven build maven-3 maven-plugin maven-deploy-plugin


【解决方案1】:

升级到最新版本的maven-deploy-plugin 为我解决了这个问题。

例如:

<build>
    <plugins>
        <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>3.0.0-M1</version>
        </plugin>
    </plugins>
</build>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-04-01
    • 1970-01-01
    • 2019-09-21
    • 2015-10-27
    • 2020-08-16
    • 2013-04-20
    • 1970-01-01
    • 2014-01-27
    相关资源
    最近更新 更多