Closed adamcohen closed 4 years ago
I've enabled issues on asdf-maven
. Have you considered using the method for setting JAVA_HOME
provided with asdf-java
?
I think I'll be removing asdf-maven
setting of JAVA_HOME
.
I've enabled issues on asdf-maven. Have you considered using the method for setting JAVA_HOME provided with asdf-java?
with the current maven/bin/exec-env, sourcing set-java-home.bash won't work because the variable set in /bin/exec-env
takes precedence. If maven/bin/exec-env
is removed, then yes, it would work.
Moved the issue to https://github.com/halcyon/asdf-maven/issues/1, closing this one so we can continue the discussion there
First off, apologies for not creating this issue in the asdf-maven repo, however, I was unable to do so because issue tracking is disabled for that repo. This bug is not related to
asdf-java
but is related toasdf-maven
. @halcyon if you can enable issue tracking in https://github.com/halcyon/asdf-maven, I'll move the issue there.Summary
I'm encountering the same issue described in JAVA_HOME not found from the
skotchpine/asdf-maven
repo. It looks likehalcyon/asdf-maven
was forked from theskotchpine/asdf-maven
repo in order to fix this exact issue, which it did in Fix missing JAVA_HOME. Unfortunately, another commit was made in Simplify setting JAVA_HOME which reintroduces the bug and preventsJAVA_HOME
from being set correctly when the.tool-versions
file has multiple versions for a single tool:Steps to reproduce
If the
.tool-versions
file contains multiple versions for a single tool, for example:Then
asdf where java
used in asdf-maven/bin/exec-env returns the following error:This prevents
JAVA_HOME
from being set correctly and causesmvn
to return the following error:If the
.tool-versions
file contains a single version for a tool, for example:Then
asdf where java
works as expected, and so doesmvn -version
:Possible fix
The fix for this bug is to revert Simplify setting JAVA_HOME and just stick with the logic implemented in Fix missing JAVA_HOME