How to list the configured repositories?

£可爱£侵袭症+ 提交于 2019-11-30 14:38:26

问题


How can I list all the repositories configured for a project?

Background: I have a pretty complex gradle build script and cannot get my NetBeans to download the sources for maven dependencies. In that issue-report I was suggested to double check the order in which mavenCentral is being imported.


回答1:


For anyone interested, here is the code to list the loaded repositories (thanks @kelemen):

task listrepos {
    doLast {
        println "Repositories:"
        project.repositories.each { println "Name: " + it.name + "; url: " + it.url }
   }
}

After adding this code to the build script, execute gradle listrepos and voilà...



来源:https://stackoverflow.com/questions/32143437/how-to-list-the-configured-repositories

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!