OpenLiberty / ci.gradle

Gradle plugins for managing Liberty profile servers #devops
Apache License 2.0
48 stars 51 forks source link

Leverage Gradle toolchain configuration for Liberty server tasks (start, dev mode) and dev mode compile #792

Open scottkurz opened 1 year ago

scottkurz commented 1 year ago

It could be useful to use a different JDK for running Gradle itself as for running Liberty tasks: e.g. the server start, as well as dev mode compile.

As noted in https://docs.gradle.org/current/userguide/toolchains.html this could look like:

java {
   toolchain {
        languageVersion = JavaLanguageVersion.of(11)
    }
}

I'm sure there's a variety of use cases... one that comes to my mind is say I have a mix of Gradle 6.x and 7.x scripts, and so would like to use a common Java 11 to run Gradle. I would like to encode the Liberty app/server Java version in the project, which might be either 8, 11, or 17.

sreich commented 1 year ago

I am interested in seeing this, as I have us utilizing toolchains in our company (as is suggested best practice, by Gradle and others)