title: sbt says "not a valid command" but plugin enabled
body: <p>I have a plugin called sonar, which is developed and published as an AutoPlugin:</p>
  
  <pre><code>object Sonar extends AutoPlugin {
  
    object autoImport {
      lazy val sonar = taskKey[Unit]("sonar")
    }
  
    import autoImport._
  
    override def trigger = allRequirements
  
    lazy val sonarTask = Def.task {
  
        &lt;snip task code here which runs sonarqube scanner&gt;
  
    }
  
  }
  </code></pre>
  
  <p>We then have a project which uses that plugin, with <code>plugins.sbt</code> that looks like this:</p>
  
  <pre><code>resolvers ++= Seq(
    "Nexus Snapshot repo" at "url here"
  )
  
  credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")
  
  addSbtPlugin("packagename" % "sonar" % "1.0-SNAPSHOT")
  </code></pre>
  
  <p>And build.sbt like this:</p>
  
  <pre><code>name := "hashing-library"
  
  organization := "org name here"
  
  scalaVersion := "2.12.6"
  autoScalaLibrary := false
  crossPaths := false
  
  
  resolvers += "Nexus Release repo" at "https://nexusurl/content/repositories/releases/"
  
  resolvers += "nexus Snapshot repo" at "https://nexusurl/content/repositories/snapshots/"
  
  credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")
  
  // Publishing options:
  publishMavenStyle := true
  publishArtifact in Test := false
  pomIncludeRepository := { x =&gt; false }
  
  publishTo := {
    val nexus = "nexus url here"
    if (isSnapshot.value)
      Some("sonatype-snapshots" at nexus + "content/repositories/snapshots")
    else
      Some("sonatype-releases" at nexus + "content/repositories/releases")
  }
  </code></pre>
  
  <p>When I try to run sbt plugins, it says the plugin is enabled:</p>
  
  <pre><code>&lt;snip output&gt;
  packagename.sonar.Sonar: enabled in hashingLibrary
  </code></pre>
  
  <p></p>
  
  <p>So why is it that my plugin is enabled, but I cannot run <code>sbt sonar</code>?  When I do, it says:</p>
  
  <pre><code>[info] Set current project to hashing-library (in build file:/home/work/hashing-library/)
  [error] Not a valid command: sonar
  [error] Not a valid project ID: sonar
  [error] Expected ':'
  [error] Not a valid key: sonar
  [error] sonar
  [error]   
  </code></pre>
  
  <p>(Obviously org names and url's have been removed to protect confidentiality of my client, but hopefully that doesn't impact my question!)</p>