title: Gradle install command to publish locally with version and groupId
body: <p>I'm trying to get a Java/Gradle project to build a shared/non-executable library JAR and publish it to my local Maven repo (so that I can pull it into other projects I'm working on locally).</p>
  
  <p>My <code>build.gradle</code>:</p>
  
  <pre><code>plugins {
      id 'java'
      id 'maven'
  }
  
  version = '0.0.1-SNAPSHOT'
  group = 'mygroup'
  rootProject.name = 'myproject'
  
  repositories {
      jcenter()
      mavenCentral()
  }
  
  dependencies {
      compile(
          'ch.qos.logback:logback-classic:1.2.3'
          ,'org.apache.commons:commons-lang3:3.7'
      )
  
      testCompile(
          'junit:junit:4.12'
          ,'org.mockito:mockito-core:2.23.0'
      )
  }
  
  test {
      // Trick to run tests in parallel with as much concurrency as possible.
      maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
  }
  
  jar {
      baseName = rootProject.name
  }
  </code></pre>
  
  <p>And how I'm invoking it:</p>
  
  <pre><code>./gradlew clean build install
  </code></pre>
  
  <p>On my file system I see a <code>/home/.m2/repository/myproject/unspecified/</code> directory (<code>myrpoject</code> is the name of my project and is correct) that contains:</p>
  
  <ul>
  <li><code>myproject.jar</code>; and</li>
  <li><code>myproject.pom</code></li>
  </ul>
  
  <p>I'm <strong>so close</strong>! I'm just trying to figure out to replace the <code>unspecified</code> version number with my configured value (<code>0.0.1-SNAPSHOT</code>) as well as how to change the installation directory to <code>/home/.m2/repository/mygroup/myproject/unspecified/</code> (note the <code>mygroup</code> addition!)?</p>