{"action":"created","issue":{"url":"https://api.github.com/repos/ben-manes/gradle-versions-plugin/issues/274","repository_url":"https://api.github.com/repos/ben-manes/gradle-versions-plugin","labels_url":"https://api.github.com/repos/ben-manes/gradle-versions-plugin/issues/274/labels{/name}","comments_url":"https://api.github.com/repos/ben-manes/gradle-versions-plugin/issues/274/comments","events_url":"https://api.github.com/repos/ben-manes/gradle-versions-plugin/issues/274/events","html_url":"https://github.com/ben-manes/gradle-versions-plugin/issues/274","id":382534589,"node_id":"MDU6SXNzdWUzODI1MzQ1ODk=","number":274,"title":"support to configure other repositories to check for newer versions","user":{"login":"nkiesel","id":1134209,"node_id":"MDQ6VXNlcjExMzQyMDk=","avatar_url":"https://avatars2.githubusercontent.com/u/1134209?v=4","gravatar_id":"","url":"https://api.github.com/users/nkiesel","html_url":"https://github.com/nkiesel","followers_url":"https://api.github.com/users/nkiesel/followers","following_url":"https://api.github.com/users/nkiesel/following{/other_user}","gists_url":"https://api.github.com/users/nkiesel/gists{/gist_id}","starred_url":"https://api.github.com/users/nkiesel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkiesel/subscriptions","organizations_url":"https://api.github.com/users/nkiesel/orgs","repos_url":"https://api.github.com/users/nkiesel/repos","events_url":"https://api.github.com/users/nkiesel/events{/privacy}","received_events_url":"https://api.github.com/users/nkiesel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-11-20T07:31:06Z","updated_at":"2018-11-20T21:04:54Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nour gradle builds are normally only allowed to resolve dependencies against our local artifactory based repo (to make sure developers only use \"blessed\" jars/versions).  Therefore, I always end up temporarily adding \"jcenter()\" at to top of the repo list before I use this wonderful plugin.  I wonder if you could add a configuration that would automate that?  Something like\r\n```\r\ndependencyUpdates.additionalRepositories {\r\n    jcenter()\r\n}\r\n``` "},"comment":{"url":"https://api.github.com/repos/ben-manes/gradle-versions-plugin/issues/comments/440428986","html_url":"https://github.com/ben-manes/gradle-versions-plugin/issues/274#issuecomment-440428986","issue_url":"https://api.github.com/repos/ben-manes/gradle-versions-plugin/issues/274","id":440428986,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDQyODk4Ng==","user":{"login":"nkiesel","id":1134209,"node_id":"MDQ6VXNlcjExMzQyMDk=","avatar_url":"https://avatars2.githubusercontent.com/u/1134209?v=4","gravatar_id":"","url":"https://api.github.com/users/nkiesel","html_url":"https://github.com/nkiesel","followers_url":"https://api.github.com/users/nkiesel/followers","following_url":"https://api.github.com/users/nkiesel/following{/other_user}","gists_url":"https://api.github.com/users/nkiesel/gists{/gist_id}","starred_url":"https://api.github.com/users/nkiesel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkiesel/subscriptions","organizations_url":"https://api.github.com/users/nkiesel/orgs","repos_url":"https://api.github.com/users/nkiesel/repos","events_url":"https://api.github.com/users/nkiesel/events{/privacy}","received_events_url":"https://api.github.com/users/nkiesel/received_events","type":"User","site_admin":false},"created_at":"2018-11-20T21:04:54Z","updated_at":"2018-11-20T21:04:54Z","author_association":"NONE","body":"I now have the following:\r\n```\r\n// add jcenter() as first element to repositories when looking for possible\r\n// dependency upgrades\r\ntasks.dependencyUpdates.doFirst {\r\n    // first add jcenter to the end of the list\r\n    repositories {\r\n\tjcenter()\r\n    }\r\n    // get the last element which is the just added jcenter\r\n    def jcenter = repositories[-1]\r\n    // remove jcenter. The repo container guarantees that names are unique, so\r\n    // this will always work correctly\r\n    repositories.removeIf { it.name == jcenter.name }\r\n    // and now add again as first repository\r\n    repositories.addFirst(jcenter)\r\n}\r\n```\r\nThe good news is that this technically seems to work (I listed the repos and jcenter indeed ends up as the first). The bad news is that the result of running with this configuration is very different than with the configuration where I add jcenter directly into my repo list (and comment out the above).  The former misses available updated versions that the latter finds.\r\nOne aspect that might be relevant here is that we have a multi-module setup and that the standard repositories block is thus inside `allProjects`, while the code block above is outside."}}
{"actor":{"display_login":"nkiesel"}}