halcyon / asdf-maven

Maven plugin for the asdf version manager.
MIT License
32 stars 19 forks source link

asdf-maven doesn't use asdf-java #17

Closed ccjmne closed 1 month ago

ccjmne commented 1 month ago

Hi,

I used to work with SDKMAN! and recently figured I would like to give asdf a spin. It's been working splendidly so far.

I should start this report with the following preface: the issue is most definitely on my end, most definitely because I have two different versions managers "conflicting" for Java and Maven on my system... if you cannot help with this user issue, I will not take it personally ;)

I installed the asdf-java and asdf-maven plugins, installed a (few) version(s) of Java and Maven, used asdf local java XXX (and the same with maven) to generate a local .tools-config; it all looks perfect. java -version yields the version described in .tools-versions; the same holds true with maven: so far so good.

However, I'd like Maven to also point to the correct Java version in my current working directory...

The issue certainly comes from my lack of understanding of how these things work precisely, and I could use some of your insight.

For clarity, here's an excerpt that demonstrates the situation I'm facing:

>  cat .tool-versions
java temurin-8.0.422+5
maven 3.9.9
>  java -version
openjdk version "1.8.0_422"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_422-b05)
OpenJDK 64-Bit Server VM (Temurin)(build 25.422-b05, mixed mode)
>  mvn -version
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: /home/ccjmne/.local/share/asdf/installs/maven/3.9.9
Java version: 11.0.23, vendor: Eclipse Adoptium, runtime: /home/ccjmne/.sdkman/candidates/java/11.0.23-tem

I really appreciate any help you can provide.

ccjmne commented 1 month ago

I'll clean up my system and reopen afterwards, if it hasn't gotten any better :)