Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tool error reporting still buggy #593

Closed
2 tasks done
hohwille opened this issue Sep 5, 2024 · 1 comment · Fixed by #652
Closed
2 tasks done

Tool error reporting still buggy #593

hohwille opened this issue Sep 5, 2024 · 1 comment · Fixed by #652
Labels
bug Something isn't working

Comments

@hohwille
Copy link
Member

hohwille commented Sep 5, 2024

$ 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 stacktrace and the error message is simply confusing here. There is no bug in IDEasy and none should be reported. Do we need an additional error handling for process context, or should we implement our own error handling in the runTool method instead of using ERROR for ProcessContext?
  • the actual output of the tool that has been invoked (here mvn) is lost and not visible to the end-user. However, this is the most important information that is missing here. Seems we capture the output for ProcessContext. There can be usages of runTool where this may be necessary but for this we have an extra argument. The default should not behave like this. ATTENTION: This point is now addressed by a separate issue Enhance error messsages of ProcessBuilder #608

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
Copy link
Contributor

jan-vcapgemini commented Sep 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants