Gradle build doesn't download dependencies

前端 未结 5 1431
暖寄归人
暖寄归人 2020-12-14 09:52

After running gradle build in the root directory of my my web app, the spring security dependency declared in build.gradle does not get downloaded.

5条回答
  •  感情败类
    2020-12-14 10:08

    If your project builds successfully some time it may be gradle download problem with a current proxy. Gradle has it's own dependency management system similar to maven. I think parts of the gradle publish plugin are backed by maven in some way (not verified). Regardless you shouldn't have to worry about that level of depth, gradle will handle it. Your problem is setting up the proxy. You just need to set some variables in $projectDir/gradle.properties, for example:

    #http proxy setup
    systemProp.http.proxyHost=www.somehost.org
    systemProp.http.proxyPort=8080
    systemProp.http.proxyUser=userid
    systemProp.http.proxyPassword=password
    systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
    

    This can be used to download dependencies without proxy. If you want to use a proxy for you can use the code as below instead of above code.

    systemProp.https.proxyPort=3128
    systemProp.http.proxyHost=192.168.16.2
    systemProp.https.proxyHost=192.168.16.2
    systemProp.http.proxyPort=3128
    

    Proxy port and host can be changed as you want.

提交回复
热议问题