This is more a process question than a Gradle or Java question. Ultimately, you must get everyone to specify their various JAVA_HOME, without being burdensome. You have several options:
- Command line: ./ gradlew -Dorg.gradle.java.home = / path_to_jdk_directory
But, of course, now everyone should type some disgusting garbage into their command line every time they start the assembly.
- gradle.properties and check the path. Then get everyone to use the same path.
Not everyone wants to use the same path, especially if you have Mac / Unix and PC users.
2b. Instead of using the identical path, everyone can change their local gradle.properties with their custom values ββand then never log their changes.
The primary problem: someone is completely going to test their local values ββand spoil the CI and everyone else.
- gradle.properties.template check-in, each creates its own gradle.properties; type gradle.properties in .gitignore
This may be your best bet. You have a template file that you register, but everyone should copy it to gradle.properties and fill in their specific values. You need to configure your CI to do something similar, or register something like gradle.ci.properties and use CI. But everyone has to do it once, and not once for assembly. Unfortunately, they will have to update their personal file every time the template changes (unless you have written code for this).
source share