You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2022/10/20 08:11:02 UTC
[jira] [Updated] (MNG-7340) --fail-on-severity/-fos eats remaining CLI arguments
[ https://issues.apache.org/jira/browse/MNG-7340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Guillaume Nodet updated MNG-7340:
---------------------------------
Fix Version/s: 4.0.0-alpha-2
> --fail-on-severity/-fos eats remaining CLI arguments
> ----------------------------------------------------
>
> Key: MNG-7340
> URL: https://issues.apache.org/jira/browse/MNG-7340
> Project: Maven
> Issue Type: Bug
> Components: Command Line
> Reporter: Maarten Mulders
> Assignee: Maarten Mulders
> Priority: Blocker
> Labels: up-for-grabs
> Fix For: 4.0.0-alpha-1, 4.0.0-alpha-2, 4.0.0
>
>
> 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:
> {quote}[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]{quote}
> If you change the order of the invocation to {{{}mvn package -fos WARN{}}}, it works as expected:
> {quote}[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{quote}
> This is because the Commons CLI "option" for {{--fail-on-severity}} accepts multiple arguments, where it should accept only one.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)