Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7340

--fail-on-severity/-fos eats remaining CLI arguments

    XMLWordPrintableJSON

Details

    Description

      When you invoke Maven with mvn -fos WARN package on any project, you would expect the build to run until the package phase; when a warning would be logged, the build should fail.

      However, the build fails with a different reason:

      [ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy, wrapper. -> [Help 1]

      If you change the order of the invocation to mvn package -fos WARN, it works as expected:

      [INFO] Enabled to break the build on log level WARN.
      [INFO] Scanning for projects...
      [INFO] --------------------------------------------------------------------------------------------------------------------------
      [INFO] Reactor Build Order:

      ...

      [ERROR] Build failed due to log statements with a higher severity than allowed. Fix the logged issues or remove flag --fail-on-severity (-fos).
      [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 verbose output

      This is because the Commons CLI "option" for --fail-on-severity accepts multiple arguments, where it should accept only one.

      Attachments

        Issue Links

          Activity

            People

              mthmulders Maarten Mulders
              mthmulders Maarten Mulders
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: