title: How to release and reference Grails plugins using local Maven repository
body: <p>Summary</p>
  
  <p>I create two plugins A and B with Grails 2.3.4 where B is a plugin used by A plugin. I get error when I use A plugin in my application. </p>
  
  <p>Details</p>
  
  <p>When I run the following command, for plugin B, it successfully release the plugin to local maven repository. I can see it in the ~/.m2/... folder. </p>
  
  <pre><code>~plugin-b: grails maven-install
  </code></pre>
  
  <p>Then I add a reference to plugin B with plugin A, so I add the reference to BuildConfig in plugin A:</p>
  
  <pre><code>plugins {
      compile "com.test.plugins:b:1.0.0-SNAPSHOT"
  }
  </code></pre>
  
  <p>Now, I think, I should be able to run the next command and the plugin should be released to the local maven repository but I get the error instead: </p>
  
  <pre><code>~plugin-a: grails maven-install
  | Plugin packaged grails-a-1.0.0-SNAPSHOT.zip
  | Generating POM file.....
  | Error Could not find artifact com.test.plugins:b:jar:1.0.0-SNAPSHOT (scope: compile) (Use --stacktrace to see the full trace)
  | POM generated: //dependencies/dependencies_A_plugin/target/pom.xml...
  Maven install complete. 
  </code></pre>
  
  <p>Here is the generated POM file: </p>
  
  <pre><code> // pom header
   &lt;artifactId&gt;a&lt;/artifactId&gt;
    &lt;packaging&gt;zip&lt;/packaging&gt;
    &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;A&lt;/name&gt;
    &lt;description&gt;Brief summary/description of the plugin.
  &lt;/description&gt;
    &lt;url&gt;http://grails.org/plugin/a&lt;/url&gt;
    &lt;developers&gt;
      &lt;developer&gt;
        &lt;name&gt;Your name&lt;/name&gt;
      &lt;/developer&gt;
    &lt;/developers&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;com.test.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;b&lt;/artifactId&gt;
        &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
        &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      ... just ending tags
  </code></pre>
  
  <p>Actually, also plugin A has been released to the local Maven repository, but it is probably corrupted, because when I create a Grails application and add a reference to A plugin into BuildConfig, then I am not even able to start up that application. </p>
  
  <pre><code>~ grails
  | Error Resolve error obtaining dependencies: Could not find artifact com.test.plugins:b:jar:1.0.0-SNAPSHOT (Use --stacktrace to see the full trace)
  | Error Could not find artifact com.test.plugins:b:jar:1.0.0-SNAPSHOT
  </code></pre>
  
  <p>So, the application has found A plugin, but not the B plugin, which is referenced by A plugin. To me, it seems there is an issue with generated POM file in the local Maven repository for the A plugin. There is probably missing:</p>
  
  <pre><code>  &lt;type&gt;zip&lt;/type&gt;
  </code></pre>
  
  <p>But I have not found a way how to add the type to that dependency. </p>
  
  <p>Anyone able to help?</p>