-
Notifications
You must be signed in to change notification settings - Fork 193
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
Error messages like "Reference to undefined variable foo" should explain where the variable is referenced #2591
Comments
full text search of "Reference to undefined variable" leads to VariablesMessages.properties StringSubstitutionEngine_3 |
I ran into this with a client project too. Normally one authors a launch configuration and one knows if one has decided to use string substitutions in it, so then the message is obvious when it appears. But now it seems m2e is the one adding such variables (if the pom.xml uses a variable); perhaps m2e should be expanding the variable, and if not, perhaps should generate a string substitution for it. E.g., there was stuff like this in the pom.xml so for the Oomph setup I had to define an empty string substitution for
Has something changes in m2e such that variables in the pom end up being variables in the launch configuration, e.g., when the variable can't be expanded by maven/m2e? Is that a bug or a feature? It's really confusing for users who have might never have used a string substitution... I assume this is similar to your case? I believe it's m2e doing that copying not anything in Maven itself. What help would you expect from the message? A description of which tab of which launch configuration to inspect? Often users aren't really all that aware of the launch configuration either... |
This should be fixed in the latest m2e release that's also included in the 2024-12 SimRel. If the error still exists, please create an issue in: Closing this here because it's a bug in m2e, that is hopefully fixed already. |
Yes this was a problem with m2e that I hear was fixed. However, I still think that if Eclipse has a variable that isn't resolved it should, yes, describe the location to inspect to find the variable. In this case, I would assume the current launch configuration so just the location would be enough. In my OP the example just appended the location "in Runtime Configuration VM arguments":
|
When running a junit test or other runtime configuration, I was getting an undefined variable error but I had no idea what it was talking about. Finally I found that the VM arguments had a ${foo} that did not have a value that was copied there by maven's surefire plugin when I upgraded to 2024.09. The message would be improved if it was something like:
I did a naive walk thru the Eclipse code looking for the error message but don't have enough domain knowledge to recommend a fix. If someone points me to the line generating that code I will work to add that context.
The text was updated successfully, but these errors were encountered: