Any Drawbacks of Sharing the Gradle User Home with Many Developers?

前端 未结 2 1795
清酒与你
清酒与你 2021-01-14 15:40

Question

In a Nutshell

Are there any drawbacks of sharing the Gradle user home amongst multiple developers on the same filesystem?

In More Detai

相关标签:
2条回答
  • 2021-01-14 16:09

    I have just found this comment by Gradle developer Stefan Oehme wrt. sharing the Gradle user home:

    Gradle processes will hold locks if they are uncontended (to gain performance). Contention is announced through inter-process communication, which does not work when the processes are isolated in Docker containers.

    And more clearly he states in a follow-up comment (highlighting by me):

    There might be other issues that we haven't yet discovered though, since sharing a user home between machines is not a use case we have designed for.

    In other words: sharing a Gradle user home or even just the cache part of it across different machines is currently not officially supported by Gradle.

    Update for Gradle 6.1+

    The Gradle user home is still not meant to be shared, however, it is now at least “perfectly possible to copy a cache around” (cf. the user guide). Not sure what that means for concurrent access from different hosts; it still provides a basis for more sharing scenarios than were officially supported before.

    0 讨论(0)
  • 2021-01-14 16:10

    As you reference ~/.gradle/, I guess you are on a *nix machine?
    Then simply make the cache folder a symlink to some shared folder and you will be fine. Cache will be shared and each dev still has his own Gradle user home.

    0 讨论(0)
提交回复
热议问题