Expected behavior
As a IDEasy user, I want to get helpful error messages in case of config errors and a robust behaviour so that I do not waste my time with deep debugging of the product internals.
Actual behavior
$ ide install mvn
Start: Install mvn
Step 'ide (install,mvn)' failed: java.lang.NullPointerException
Step 'Install mvn (null)' failed: java.lang.NullPointerException
2 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/IDEasy/issues/new?assignees=&labels=bug&projects=&template=bug.md&title=java.lang.NullPointerException
java.lang.NullPointerException
at com.devonfw.tools.ide.tool.LocalToolCommandlet.install(LocalToolCommandlet.java:82)
at com.devonfw.tools.ide.tool.ToolCommandlet.install(ToolCommandlet.java:223)
at com.devonfw.tools.ide.commandlet.InstallCommandlet.run(InstallCommandlet.java:49)
at com.devonfw.tools.ide.context.AbstractIdeContext.applyAndRun(AbstractIdeContext.java:862)
at com.devonfw.tools.ide.context.AbstractIdeContext.run(AbstractIdeContext.java:771)
at com.devonfw.tools.ide.cli.Ideasy.runOrThrow(Ideasy.java:89)
at com.devonfw.tools.ide.cli.Ideasy.run(Ideasy.java:52)
at com.devonfw.tools.ide.cli.Ideasy.main(Ideasy.java:29)
at java.base@21.0.2/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Error: IDEasy failed with exit code 255
Steps to reproduce (bug) / Use Case of feature request (enhancement)
- edit your config (
devon.properties or ide.properties):
MVN_VERSION=3.9.6
MAVEN_VERSION=${MVN_VERSION}
- ide install mvn
Related/Dependent Issues
Comments/Hints:
I hit multiple problems here. First of all MAVEN_VERSION=${MVN_VERSION} is a legacy workaround that could be used in devonfw-ide to make the configuration work also with older versions of devonfw-ide that expected MAVEN_VERSION what was changed in newer releases.
Further with #104 we implemented that the value of a variable can reference other variables including itself so ${MVN_VERSION} can be evaluated by EnvironmentVariablesResolved.
However, we also implemented variable legacy support via IdeVariableDefinition with legacy name for fallbacks:
The goal is that we can read legacy variables from devonfw-ide easily even though they may not be physically defined in any properties file by "redirecting" it from the legacy name to the new name.
To simplify variable resolution, we also consider that when loading properties and already store them under the new instead of the legacy name since otherwise we might have two variables defined for the same thing with different values (MVN_VERSION=3.9.9 and MAVEN_VERSION=3.0.0). However, if we then only use the new one for installation and processing but have template configuration files with ${MAVEN_VERSION} or $[MAVEN_VERSION], we might end up with the wrong value.
Further, a lot of edge-cases can happen here.
Assuming we have:
LEGACY_X=legacyX
NEW_X=newX
NEW_X=newX2
NEW_Y=newY
LEGACY_Y=legacyY
The expected result should be the same as for
Further while loading these strange assumed config, we should log warnings so the user gets informed that his configuration is odd and he should probably do a cleanup.
In the future we might want to add a commandlet to automatically cleanup all configs and migrate to IDEasy:
- convert devon.properties to ide.properties
- remove legacy variables and only have new/official variables
- convert curly variable syntax for supported variables in all templates to bracket variable syntax (in combination
${DEVON_IDE_HOME} -> $[IDE_HOME]).
- etc.
Affected version:
- 2024.11.001-beta-SNAPSHOT
Expected behavior
As a IDEasy user, I want to get helpful error messages in case of config errors and a robust behaviour so that I do not waste my time with deep debugging of the product internals.
Actual behavior
Steps to reproduce (bug) / Use Case of feature request (enhancement)
devon.propertiesoride.properties):Related/Dependent Issues
Comments/Hints:
I hit multiple problems here. First of all
MAVEN_VERSION=${MVN_VERSION}is a legacy workaround that could be used indevonfw-ideto make the configuration work also with older versions ofdevonfw-idethat expectedMAVEN_VERSIONwhat was changed in newer releases.Further with #104 we implemented that the value of a variable can reference other variables including itself so
${MVN_VERSION}can be evaluated byEnvironmentVariablesResolved.However, we also implemented variable legacy support via
IdeVariableDefinitionwith legacy name for fallbacks:IDEasy/cli/src/main/java/com/devonfw/tools/ide/variable/VariableDefinition.java
Line 24 in d967d69
The goal is that we can read legacy variables from devonfw-ide easily even though they may not be physically defined in any properties file by "redirecting" it from the legacy name to the new name.
To simplify variable resolution, we also consider that when loading properties and already store them under the new instead of the legacy name since otherwise we might have two variables defined for the same thing with different values (MVN_VERSION=3.9.9 and MAVEN_VERSION=3.0.0). However, if we then only use the new one for installation and processing but have template configuration files with
${MAVEN_VERSION}or$[MAVEN_VERSION], we might end up with the wrong value.Further, a lot of edge-cases can happen here.
Assuming we have:
The expected result should be the same as for
Further while loading these strange assumed config, we should log warnings so the user gets informed that his configuration is odd and he should probably do a cleanup.
In the future we might want to add a commandlet to automatically cleanup all configs and migrate to IDEasy:
${DEVON_IDE_HOME}->$[IDE_HOME]).Affected version: