{"action":"created","issue":{"url":"https://api.github.com/repos/sbt/sbt/issues/3393","repository_url":"https://api.github.com/repos/sbt/sbt","labels_url":"https://api.github.com/repos/sbt/sbt/issues/3393/labels{/name}","comments_url":"https://api.github.com/repos/sbt/sbt/issues/3393/comments","events_url":"https://api.github.com/repos/sbt/sbt/issues/3393/events","html_url":"https://github.com/sbt/sbt/issues/3393","id":246678540,"number":3393,"title":"^compile does not resolve correct version of sbt plugin dependency (using addSbtPlugin)","user":{"login":"jeffreyolchovy","id":202277,"avatar_url":"https://avatars2.githubusercontent.com/u/202277?v=4","gravatar_id":"","url":"https://api.github.com/users/jeffreyolchovy","html_url":"https://github.com/jeffreyolchovy","followers_url":"https://api.github.com/users/jeffreyolchovy/followers","following_url":"https://api.github.com/users/jeffreyolchovy/following{/other_user}","gists_url":"https://api.github.com/users/jeffreyolchovy/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffreyolchovy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffreyolchovy/subscriptions","organizations_url":"https://api.github.com/users/jeffreyolchovy/orgs","repos_url":"https://api.github.com/users/jeffreyolchovy/repos","events_url":"https://api.github.com/users/jeffreyolchovy/events{/privacy}","received_events_url":"https://api.github.com/users/jeffreyolchovy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/sbt/sbt/milestones/30","html_url":"https://github.com/sbt/sbt/milestone/30","labels_url":"https://api.github.com/repos/sbt/sbt/milestones/30/labels","id":2670908,"number":30,"title":"0.13.17","description":"","creator":{"login":"dwijnand","id":344610,"avatar_url":"https://avatars1.githubusercontent.com/u/344610?v=4","gravatar_id":"","url":"https://api.github.com/users/dwijnand","html_url":"https://github.com/dwijnand","followers_url":"https://api.github.com/users/dwijnand/followers","following_url":"https://api.github.com/users/dwijnand/following{/other_user}","gists_url":"https://api.github.com/users/dwijnand/gists{/gist_id}","starred_url":"https://api.github.com/users/dwijnand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwijnand/subscriptions","organizations_url":"https://api.github.com/users/dwijnand/orgs","repos_url":"https://api.github.com/users/dwijnand/repos","events_url":"https://api.github.com/users/dwijnand/events{/privacy}","received_events_url":"https://api.github.com/users/dwijnand/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":2,"state":"open","created_at":"2017-07-31T10:16:51Z","updated_at":"2017-08-10T15:40:54Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2017-07-31T08:19:38Z","updated_at":"2017-08-13T19:44:39Z","closed_at":null,"body":"## steps\r\nGiven a build.sbt for an sbt plugin that needs to include another sbt plugin as a library dependency (e.g. we are creating an AutoPlugin which requires this other sbt plugin):\r\n\r\n```scala\r\nsbtPlugin := true\r\n\r\ncrossSbtVersions := Seq(\"0.13.16\", \"1.0.0-RC3\")\r\n\r\naddSbtPlugin(\"com.eed3si9n\" % \"sbt-buildinfo\" % \"0.7.0\")\r\n```\r\n\r\n## problem\r\nWhen attempting to cross-build (`^compile`) this plugin for the given versions of sbt, the resolution for the plugin used as a dependency fails:\r\n\r\n```\r\n> ^compile\r\n[info] Setting `sbtVersion in pluginCrossBuild` to 0.13.16\r\n[info] Set current project to sbt-issue (in build file:/Users/jeffo/Projects/jvm/sbt-issue/)\r\n[success] Total time: 2 s, completed Jul 31, 2017 10:09:42 AM\r\n[info] Setting `sbtVersion in pluginCrossBuild` to 1.0.0-RC3\r\n[info] Set current project to sbt-issue (in build file:/Users/jeffo/Projects/jvm/sbt-issue/)\r\n[info] Resolving com.eed3si9n#sbt-buildinfo;0.7.0 ...\r\n[warn] \tmodule not found: com.eed3si9n#sbt-buildinfo;0.7.0\r\n[logging elided] ...\r\n[warn] \t::::::::::::::::::::::::::::::::::::::::::::::\r\n[warn] \t::          UNRESOLVED DEPENDENCIES         ::\r\n[warn] \t::::::::::::::::::::::::::::::::::::::::::::::\r\n[warn] \t:: com.eed3si9n#sbt-buildinfo;0.7.0: not found\r\n[warn] \t::::::::::::::::::::::::::::::::::::::::::::::\r\n[warn] \r\n[warn] \tNote: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.\r\n[warn] \t\tcom.eed3si9n:sbt-buildinfo:0.7.0 (scalaVersion=2.12, sbtVersion=0.13)\r\n[warn] \r\n[warn] \tNote: Unresolved dependencies path:\r\n[warn] \t\tcom.eed3si9n:sbt-buildinfo:0.7.0 (scalaVersion=2.12, sbtVersion=0.13) (/Users/jeffo/Projects/jvm/sbt-issue-1/build.sbt#L5-6)\r\n[warn] \t\t  +- default:sbt-issue-1:0.1-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)\r\n[trace] Stack trace suppressed: run last *:update for the full output.\r\n[error] (*:update) sbt.ResolveException: unresolved dependency: com.eed3si9n#sbt-buildinfo;0.7.0: not found\r\n```\r\n## expectation\r\nI would expect `addSbtPlugin` to use the correct version of Scala, conditionally, for each version of sbt that it is attempting to compile against.\r\n\r\n\r\n## notes\r\nThis can be worked around by replacing `addSbtPlugin` with the following:\r\n```scala\r\nlibraryDependencies += {\r\n  val currentSbtVersion = (sbtBinaryVersion in pluginCrossBuild).value\r\n  Defaults.sbtPluginExtra(\"com.eed3si9n\" % \"sbt-buildinfo\" % \"0.7.0\", currentSbtVersion, scalaBinaryVersion.value)\r\n}\r\n```\r\n\r\nsbt version: 0.13.16, cross building for 0.13.16 and 1.0.0-RC3\r\n"},"comment":{"url":"https://api.github.com/repos/sbt/sbt/issues/comments/322063019","html_url":"https://github.com/sbt/sbt/issues/3393#issuecomment-322063019","issue_url":"https://api.github.com/repos/sbt/sbt/issues/3393","id":322063019,"user":{"login":"eed3si9n","id":184683,"avatar_url":"https://avatars0.githubusercontent.com/u/184683?v=4","gravatar_id":"","url":"https://api.github.com/users/eed3si9n","html_url":"https://github.com/eed3si9n","followers_url":"https://api.github.com/users/eed3si9n/followers","following_url":"https://api.github.com/users/eed3si9n/following{/other_user}","gists_url":"https://api.github.com/users/eed3si9n/gists{/gist_id}","starred_url":"https://api.github.com/users/eed3si9n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eed3si9n/subscriptions","organizations_url":"https://api.github.com/users/eed3si9n/orgs","repos_url":"https://api.github.com/users/eed3si9n/repos","events_url":"https://api.github.com/users/eed3si9n/events{/privacy}","received_events_url":"https://api.github.com/users/eed3si9n/received_events","type":"User","site_admin":false},"created_at":"2017-08-13T19:44:39Z","updated_at":"2017-08-13T19:44:39Z","body":"Fix was merged to 0.13 branch - https://github.com/sbt/sbt/pull/3397\r\nStill needs forward porting to 1.x branch"}}
{"actor":{"display_login":"eed3si9n"}}