2

There is a similar question to this, but none of the answers actually work. I am trying to create a windows batch script that will redownload Gradle dependencies and clear all dependencies caches. The only way that works now is clicking on "Refresh Gradle Dependencies" inside IntelliJ:

enter image description here

How can I achieve the same result through a terminal command or Gradle task if that is even possible?

Commands like gradlew.bat build --refresh-dependencies or gradlew.bat --refresh-dependencies are not redownloading all the project dependencies as the IntelliJ option does.

Mostafa Ghorbani
  • 397
  • 1
  • 3
  • 15
Tomislav Brabec
  • 529
  • 2
  • 14
  • 20
  • This site helps with a fix for your provided code; so in order to assist you, you need to provide that code. Please use the edit facility, to include your code, and the debugging information necessary for us to recreate, and diagnose your issue, so that we can assist you with it. – Compo Dec 17 '20 at 12:46
  • You have a link but did not mention what have you tried and what did not work. – Andrey Dec 17 '20 at 13:27
  • Looks like you need a script that would run a Gradle build with the `refresh-dependencies` option and (possibly) deleting the Gradle cache before this build. – Andrey Dec 17 '20 at 13:30
  • @Andrey As I mentioned, none of answers did work for me. I have tried them all. Also, gradlew.bat build --refresh-dependencies is one of them which did not work. Only thing for now that works is when I run Refresh Gradle Dependencies from IntelliJ and I want to run the same via command if that is possible. I think that question is clear enough. I can copy all answers from linked page but what is the point then? – Tomislav Brabec Dec 17 '20 at 14:47
  • @Andrey It is also probably deleting caches, but I don't know how can I delete caches per project (if it works like that)? – Tomislav Brabec Dec 17 '20 at 14:57

0 Answers0