How to prevent the gradle project from automatically downloading dependency packages to the C drive every time

When Idea opens a gradle project for the first time, it will download the dependency packages required for the project on the C drive, which often takes up several gigabytes of space on the C drive.
Although gradle has been installed locally, after entering idea, you need to manually modify the project configuration. At this time, idea has begun to depend on the c drive.

Solution: Create a new variable named in the system environment variables GRADLE_USER_HOMEand specify a directory for it.

Insert image description here
After configuring this option, when idea loads the dependency package of the gradle project for the first time in the future, it will be placed in the directory you set, and will not depend on the package under the c drive.

Guess you like

Origin blog.csdn.net/u014292402/article/details/128799211