java - 需要有关 Maven mojo 插件问题的帮助

标签 java maven

低于错误-

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1.1:exec (report) on project mtaf: Result of cmd.exe /X /C "java" execution is: '1'. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1.1:exec (report) on project mtaf: Result of cmd.exe
/X /C "java" execution is: '1'.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
        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:318)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)
Caused by: org.apache.maven.plugin.MojoExecutionException: Result of cmd.exe /X /C "java" execution is: '1'.
        at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:283)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more
[ERROR]
[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/MojoExecutionException

最佳答案

您正在使用 exec-maven-plugin 执行不返回代码 0(成功)的命令。插件认为此步骤失败并产生错误。该命令似乎是 cmd.exe /X /C "java" .

您需要调试此命令。为此,首先通过执行总是会成功的命令来确认问题出在命令中,例如 cmd.exe /X /C dir 。然后,您可以将原始命令包装到 Windows 命令行脚本中以收集更多信息(例如:将标准和错误输出重定向到文件)。如果该步骤可以被认为是可选的,您还可以使用它返回代码 0并指示成功 exec-maven-plugin最后maven .

关于java - 需要有关 Maven mojo 插件问题的帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18423244/

相关文章:

maven - Jenkins 为 Maven 作业执行的默认命令是什么?

java - Maven:多模块项目依赖关系未解决(父pom)

java - 可变类和不可变类

java - 使用 libGDX 绘制填充的多边形

java - 使用 ABBOTT & COSTELLO 自动测试 Web Start 程序

tomcat - 如何使用 maven :run with my custom configuration file? 运行 Tomcat

Maven (Surefire) : copy test resources from src/test/java

java - 泽西网络服务

java - Spring Cloud : How to use Feign without Ribbon

java - 如何使用 Wildfly 和 Maven 设置 Jacoco