【问题标题】:How to define the condition of Maven fail?如何定义Maven失败的条件?
【发布时间】:2019-03-29 08:33:23
【问题描述】:

我使用名为 exec-maven-plugin 的 Maven 插件来执行名为 ldapmodify 的外部 LDAP 脚本。然而,即使这个脚本执行成功,Maven 安装也会失败。这是我运行 Maven 安装时的输出:

INFO] --- exec-maven-plugin:1.4.0:exec (default) @ entity-matching-bootstrap ---
ldap_connect_to_host: TCP localhost:389
ldap_new_socket: 508
ldap_prepare_socket: 508
ldap_connect_to_host: Trying ::1 389
ldap_pvt_connect: fd: 508 tm: -1 async: 0
attempting to connect: 
connect success
ldap_add: Already exists (68)
adding new entry "dc=my-domain,dc=com"

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.969 s
[INFO] Finished at: 2018-10-24T15:29:49-04:00
[INFO] Final Memory: 26M/63M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec (default) on project entity-matching-bootstrap: Command execution failed. Process exited with an error: 68 (Exit value: 68) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/MojoExecutionException

执行脚本的结果意味着我要添加的条目已经存在于LDAP中。并且返回码 68 被 Maven 视为失败。在这种情况下是否可以设置 Maven 或 exec-maven-plugin 不失败?谢谢。

【问题讨论】:

    标签: maven openldap exec-maven-plugin


    【解决方案1】:

    Exec Maven Plugin / exec:exec:

    successCodes  int[]  退出代码被解析为不合规应用程序的成功执行(应用程序不返回 0 表示成功)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多