{"action":"created","issue":{"url":"https://api.github.com/repos/gradle/gradle/issues/7465","repository_url":"https://api.github.com/repos/gradle/gradle","labels_url":"https://api.github.com/repos/gradle/gradle/issues/7465/labels{/name}","comments_url":"https://api.github.com/repos/gradle/gradle/issues/7465/comments","events_url":"https://api.github.com/repos/gradle/gradle/issues/7465/events","html_url":"https://github.com/gradle/gradle/issues/7465","id":372107758,"node_id":"MDU6SXNzdWUzNzIxMDc3NTg=","number":7465,"title":"Parent project in composite build trying to resolve compile time dependencies of included builds using parent repo","user":{"login":"wheelerlaw","id":3081566,"node_id":"MDQ6VXNlcjMwODE1NjY=","avatar_url":"https://avatars2.githubusercontent.com/u/3081566?v=4","gravatar_id":"","url":"https://api.github.com/users/wheelerlaw","html_url":"https://github.com/wheelerlaw","followers_url":"https://api.github.com/users/wheelerlaw/followers","following_url":"https://api.github.com/users/wheelerlaw/following{/other_user}","gists_url":"https://api.github.com/users/wheelerlaw/gists{/gist_id}","starred_url":"https://api.github.com/users/wheelerlaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wheelerlaw/subscriptions","organizations_url":"https://api.github.com/users/wheelerlaw/orgs","repos_url":"https://api.github.com/users/wheelerlaw/repos","events_url":"https://api.github.com/users/wheelerlaw/events{/privacy}","received_events_url":"https://api.github.com/users/wheelerlaw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-19T20:37:42Z","updated_at":"2018-10-19T20:54:36Z","closed_at":null,"author_association":"NONE","body":"Lets say I have two Gradle projects, one of which is a Gradle plugin, and the other of which is a project that depends on the Gradle plugin. Lets call these projects `plugin`, and `project`, respectively. \r\n\r\n`project/build.gradle`:\r\n```\r\nbuildscript {\r\n    repositories {\r\n        mavenLocal()\r\n    }\r\n    \r\n    dependencies {\r\n        classpath 'com.example:plugin:0.1'\r\n    }\r\n}\r\n```\r\n\r\n`plugin/build.gradle`:\r\n```\r\ngroup = 'com.example'\r\nversion = 0.1\r\n\r\napply plugin: 'groovy'\r\n\r\nrepositories {\r\n    mavenCentral()\r\n}\r\n\r\n\r\ndependencies {\r\n    compile gradleApi()\r\n    compile 'io.github.http-builder-ng:http-builder-ng-apache:1.0.3'\r\n\r\n}\r\n```\r\n\r\nIf I am in `plugin`, I can build it perfectly fine using `gradle build`. The dependencies will be pulled in from Maven Central, and a Jar file will be produced in the `plugin/build` directory (hypothetically, of course since this plugin doesn't have any actual class files). \r\n\r\nIf I am in `project`, and I attempt to build it by including the `plugin` in a composite build with the following command:\r\n\r\n```\r\ngradle build --include-build=../plugin\r\n```\r\n\r\n...it fails, with the following error:\r\n\r\n```\r\nCould not find io.github.http-builder-ng:http-builder-ng-apache:1.0.3.\r\nSearched in the following locations:\r\n  - file:/home/wlaw/.m2/repository/io/github/http-builder-ng/http-builder-ng-apache/1.0.3/http-builder-ng-apache-1.0.3.pom\r\n  - file:/home/wlaw/.m2/repository/io/github/http-builder-ng/http-builder-ng-apache/1.0.3/http-builder-ng-apache-1.0.3.jar\r\nRequired by:\r\n    project : > project :plugin\r\n```\r\n\r\nIt appears that the parent `project` is incorrectly attempting to resolve dependencies specified in the `plugin`, but using the repository of the parent `project` (in this case, `mavenLocal()`), rather than the repository specified in the `plugin` where the dependencies was defined in the first place (in this case, `mavenCentral()`), which should certainly be considered a bug. \r\n\r\nI am using Gradle 4.8 on Ubuntu 18.04 with Java 8 64 bit. "},"comment":{"url":"https://api.github.com/repos/gradle/gradle/issues/comments/431496058","html_url":"https://github.com/gradle/gradle/issues/7465#issuecomment-431496058","issue_url":"https://api.github.com/repos/gradle/gradle/issues/7465","id":431496058,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTQ5NjA1OA==","user":{"login":"wheelerlaw","id":3081566,"node_id":"MDQ6VXNlcjMwODE1NjY=","avatar_url":"https://avatars2.githubusercontent.com/u/3081566?v=4","gravatar_id":"","url":"https://api.github.com/users/wheelerlaw","html_url":"https://github.com/wheelerlaw","followers_url":"https://api.github.com/users/wheelerlaw/followers","following_url":"https://api.github.com/users/wheelerlaw/following{/other_user}","gists_url":"https://api.github.com/users/wheelerlaw/gists{/gist_id}","starred_url":"https://api.github.com/users/wheelerlaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wheelerlaw/subscriptions","organizations_url":"https://api.github.com/users/wheelerlaw/orgs","repos_url":"https://api.github.com/users/wheelerlaw/repos","events_url":"https://api.github.com/users/wheelerlaw/events{/privacy}","received_events_url":"https://api.github.com/users/wheelerlaw/received_events","type":"User","site_admin":false},"created_at":"2018-10-19T20:54:36Z","updated_at":"2018-10-19T20:54:36Z","author_association":"NONE","body":"Just tried Gradle 4.10.2, still getting the same error. "}}
{"actor":{"display_login":"wheelerlaw"}}