devonfw / IDEasy

Tool to automate the setup and updates of a development environment for any project (Successor of devonfw-ide).
Apache License 2.0
8 stars 18 forks source link

Tool error reporting still buggy #593

Open hohwille opened 1 week ago

hohwille commented 1 week ago
$ ide mvn
[ERROR] Error executing Maven.
[ERROR] The specified user settings file does not exist: D:\d\projects\IDEasy\conf\mvn\settings.xml
Step 'ide (mvn)' failed: java.lang.IllegalStateException: Running command 'D:\projects\IDEasy\software\mvn\bin\mvn.cmd' failed: Running command 'D:\projects\IDEasy\software\mvn\bin\mvn.cmd' failed with exit code 1!
1 step(s) failed out of 3 steps.
An unexpected error occurred!
We are sorry for the inconvenience.
Please check the error below, resolve it and try again.
If the error is not on your end (network connectivity, lack of permissions, etc.) please file a bug:
https://github.com/devonfw/ide/issues/new?assignees=&labels=bug&projects=&template=bug.md&title=IllegalStateException%3A+Running+command+%27D%3A%5Cprojects%5CIDEasy%5Csoftware%5Cmvn%5Cbin%5Cmvn.cmd%27+failed%3A+Running+command+%27D%3A%5Cprojects%5CIDEasy%5Csoftware%5Cmvn%5Cbin%5Cmvn.cmd%27+failed+with+exit+code+1%21
java.lang.IllegalStateException: Running command 'D:\projects\IDEasy\software\mvn\bin\mvn.cmd' failed: Running command 'D:\projects\IDEasy\software\mvn\bin\mvn.cmd' failed with exit code 1!

The error reporting of the ProcessContext has been activated for ToolCommandlet. However, the output above is wrong:

The user invoked mvn without arguments and that gives me an error and not successful status code also if invoked without ide as prefix command. However, the maven output is not printed and instead this stacktrace is confusing.

This is the output from maven that is missing when used via IDEasy.

[INFO] Scanning for projects...
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Total time:  0.133 s
[INFO] Finished at: 2024-09-05T23:28:29+02:00
[INFO] --------------------------------------------------------------------------------------------------------------------------
[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: before:clean, clean, after:clean, before:validate, validate, after:validate, before:initialize, initialize, after:initialize, before:sources, sources, after:sources, before:resources, resources, after:resources, before:compile, compile, after:compile, before:ready, ready, after:ready, before:test-sources, test-sources, after:test-sources, before:test-resources, test-resources, after:test-resources, before:test-compile, test-compile, after:test-compile, before:test, test, after:test, before:unit-test, unit-test, after:unit-test, before:package, package, after:package, before:build, build, after:build, before:integration-test, integration-test, after:integration-test, before:verify, verify, after:verify, before:install, install, after:install, before:deploy, deploy, after:deploy, before:all, all, after:all, before:site, site, after:site, before:site-deploy, site-deploy, after:site-deploy, before:wrapper, wrapper, after:wrapper. -> [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 verbose output
[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/NoGoalSpecifiedException
jan-vcapgemini commented 3 days ago

I've tried to run mvn using the latest SNAPSHOT release (2024.09.002-beta-SNAPSHOT/ide-cli-2024.09.002-beta-20240914.023359-6-windows-x64.tar.gz) using ide on an invalid project (missing pom.xml) and got the output of mvn and the misleading error message of IDEasy.

image

So it appears that the actual output of mvn is not omitted anymore. We still have to fix the misleading error message though.