Skip refreshing dependencies in gradle

前端 未结 2 440
旧时难觅i
旧时难觅i 2021-01-17 09:12

Short version of question: Is there a way of telling gradle not to resolve dependencies? I know I can skip single task with -x switch but resolving dependen

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

    There's the --offline flag. Alternatively, you can declare a flatDir rather than a maven repository whenever the build should be run with "local" dependencies.

    0 讨论(0)
  • 2021-01-17 09:27

    For my use case, my internet is restricted so I would setup dependencies while I can still have full access. And when I'm restricted, go to Preferences, search for Gradle, and check "Offline work".

    Of course I'll have to turn it back on whenever new dependencies are added.

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