0

Issue: I want has two graalvm version in same CI server to build different quarkus version service project.

resason: Because a few old service use quarkus-1.5.1 & graalvm-20.0.0 and I can't upgrade that version. but I want use quarkus-1.13.1 & graalvm-21.0.0 in new service.

tried: add quarkus.native.graalvm-home & quarkus.native.java-home in the pom.xml, setting graalvm path, but not working.

        <properties>
            <quarkus.package.type>native</quarkus.package.type>
            <quarkus.native.additional-build-args>${qaurkusNativeArgs}</quarkus.native.additional-build-args>
            <quarkus.native.graalvm-home>${quarkus.native.java-home}</quarkus.native.graalvm-home>
            <quarkus.native.java-home>${quarkus.native.java-home}</quarkus.native.java-home>
        </properties>
LeoKao
  • 47
  • 1
  • 6

1 Answers1

1

All you need to do is set the GRAALVM_HOME environment variable when you run mvn package -Dnative.

So something like GRAALVM_HOME=/some/path mvn package -Dnative will make Quarkus use GraalVM from /some/path.

See https://quarkus.io/guides/all-config#quarkus-core_quarkus.native.graalvm-home

geoand
  • 60,071
  • 24
  • 172
  • 190
  • thanks your response, I know change environment variable can make it, but I can't change it, because GRAALVM_HOME environment variable is global scope, change it will effect my old project(use graalvm-20.0.0). if I is wrong tell me pls – LeoKao Apr 13 '21 at 15:33
  • That is not correct, if you invoke the command the way I mentioned, the environment variable will only affect that command and will not be global – geoand Apr 13 '21 at 16:25
  • Thanks your response. Let me make sure this command snippet like you meaning? – LeoKao Apr 14 '21 at 00:34
  • ‘Export GRAALVM_HOME=${PathFor21.0.0} mvn package -Dnative‘ – LeoKao Apr 14 '21 at 00:35
  • If this matches. I think I lost a few information to you, sorry. because mvn command will through agents OS account with daemon executed. so every export command will keep self. affect next mvn command. – LeoKao Apr 14 '21 at 00:35
  • 1
    No, you don't need `EXPORT ...`. Just copy and paste the command I added above. See https://unix.stackexchange.com/a/126942/141412 for details – geoand Apr 14 '21 at 08:23
  • 1
    I will try it and reply result, thanks you for patient. – LeoKao Apr 15 '21 at 09:25
  • 1
    You are right, this answer can fix a issue and don't effect other task. sorry response late and thanks you. – LeoKao Apr 29 '21 at 01:20