{"action":"created","issue":{"url":"https://api.github.com/repos/gradle/gradle/issues/1014","repository_url":"https://api.github.com/repos/gradle/gradle","labels_url":"https://api.github.com/repos/gradle/gradle/issues/1014/labels{/name}","comments_url":"https://api.github.com/repos/gradle/gradle/issues/1014/comments","events_url":"https://api.github.com/repos/gradle/gradle/issues/1014/events","html_url":"https://github.com/gradle/gradle/issues/1014","id":195473200,"number":1014,"title":"Unwanted dependency conflict resolution beyond version bounds","user":{"login":"xtracoder","id":2301820,"avatar_url":"https://avatars.githubusercontent.com/u/2301820?v=3","gravatar_id":"","url":"https://api.github.com/users/xtracoder","html_url":"https://github.com/xtracoder","followers_url":"https://api.github.com/users/xtracoder/followers","following_url":"https://api.github.com/users/xtracoder/following{/other_user}","gists_url":"https://api.github.com/users/xtracoder/gists{/gist_id}","starred_url":"https://api.github.com/users/xtracoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xtracoder/subscriptions","organizations_url":"https://api.github.com/users/xtracoder/orgs","repos_url":"https://api.github.com/users/xtracoder/repos","events_url":"https://api.github.com/users/xtracoder/events{/privacy}","received_events_url":"https://api.github.com/users/xtracoder/received_events","type":"User","site_admin":false},"labels":[{"id":460356597,"url":"https://api.github.com/repos/gradle/gradle/labels/a:bug","name":"a:bug","color":"d93f0b","default":false},{"id":457176889,"url":"https://api.github.com/repos/gradle/gradle/labels/affects-version:3.2","name":"affects-version:3.2","color":"c5def5","default":false},{"id":478384995,"url":"https://api.github.com/repos/gradle/gradle/labels/from:contributor","name":"from:contributor","color":"0052cc","default":false},{"id":281294573,"url":"https://api.github.com/repos/gradle/gradle/labels/in:dependency-management","name":"in:dependency-management","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-14T08:53:21Z","updated_at":"2016-12-18T14:40:47Z","closed_at":null,"body":"I’m not sure if this a new feature request or already a bug of not correctly working functionality _new in 3.2.x_. I’ve already asked for help here https://discuss.gradle.org/t/unwanted-upgrade-of-dependency-version/20622, but there were no replies.  Anyway – everything is below:\r\n\r\n### Background\r\nWe have large run-time modular Java-based solution – different modules are developed by different teams in following infrastructure (most probably rather common):\r\n* There is shared (for all teams) build environment with shared repository for generated modules/JARs.\r\n* Deployment environments are – (`local` – per each team) -> (`QA` | `Staging` - shared for all) -> Prod\r\n\r\nThe problems arises in following conditions:\r\n* `Team-2` develops `module-team-2` which  uses `module-team-1` and after testing locally it generates ‘release’ build and deploys their modules into `QA` container alone with the other modules already deployed there, but it fails to deploy ...\r\n* … because Team-1 over ‘last time’ already has generated some new artifacts on shared build environment/repository (and is testing them in `local servers`) - this way `module-team-2` __during build__ is linked to ‘future’ version of `module-team-1`, which is not yet deployed to `QA` or `Staging`\r\n\r\nIn our `build.gradle` we refer dependencies via ranges and it happens that during version resolution Gradle takes future versions  beyond specified range – here is how output of ‘gradle dependencies’ looks like\r\n\r\n    org.app:app-ui:[4.17.0,4.17.1) -> 4.19.0.01948\r\n\r\nBecause of that, generated artifacts use gradle-resolved version as a lower bound for dependencies and therefore fail to start on `QA` | `Staging` until Team #1 deploy their future version there (matter of 1-2 weeks). Error is like `Could not find matching version=[4.19.0,5) ..., available versions 4.17.0.02002.`\r\n\r\n### Expected Behavior\r\nVersion resolution should use available versions **within** specified range, i.e.\r\n\r\n    org.app:app-ui:[4.17.0,4.17.1) -> 4.17.0.99999\r\n\r\n### Current Behavior\r\nGradle takes version beyond specified version ranges\r\n\r\n    org.app:app-ui:[4.17.0,4.17.1) -> 4.19.0.01948\r\n\r\nNote: I tried using (new in 3.2 ?) ` resolutionStrategy.preferProjectModules() ` - nothing changed. Actually from its documentation (https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html#org.gradle.api.artifacts.ResolutionStrategy:preferProjectModules()) I did not get clear understanding of what it does. I have feeling that this directive should ‘force’ versions that are defined __explicitly__ in compile dependencies in module currently being built, but it seems it is not.\r\n\r\n### Context\r\nDescribed in ‘Background’\r\n\r\n### Steps to Reproduce (for bugs)\r\nUnfortunately I’m not sure  how to reproduce that problem outside of our build environment.\r\n\r\n### Your Environment\r\nGradle + Java + Jenkins as build env + OSGI container (Karaf) as runtime env.\r\n"},"comment":{"url":"https://api.github.com/repos/gradle/gradle/issues/comments/267824874","html_url":"https://github.com/gradle/gradle/issues/1014#issuecomment-267824874","issue_url":"https://api.github.com/repos/gradle/gradle/issues/1014","id":267824874,"user":{"login":"oehme","id":1191797,"avatar_url":"https://avatars.githubusercontent.com/u/1191797?v=3","gravatar_id":"","url":"https://api.github.com/users/oehme","html_url":"https://github.com/oehme","followers_url":"https://api.github.com/users/oehme/followers","following_url":"https://api.github.com/users/oehme/following{/other_user}","gists_url":"https://api.github.com/users/oehme/gists{/gist_id}","starred_url":"https://api.github.com/users/oehme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oehme/subscriptions","organizations_url":"https://api.github.com/users/oehme/orgs","repos_url":"https://api.github.com/users/oehme/repos","events_url":"https://api.github.com/users/oehme/events{/privacy}","received_events_url":"https://api.github.com/users/oehme/received_events","type":"User","site_admin":false},"created_at":"2016-12-18T14:40:47Z","updated_at":"2016-12-18T14:40:47Z","body":"Can you please provide a small reproducible example? If this was the only dependency then Gradle should pick one inside the range. My best guess is that some other dependency is transitively pulling in the newer version. Gradle uses the newest version on conflicts. You can tell Gradle to fail on version conflicts instead to find problems like these earlier."}}
{"actor":{"display_login":"oehme"}}