title: Gradle java-platform plugin and platform definition
body: <p>I'm trying to use the <code>java-platform</code> plugin to share dependency constraints in a multi-module project. What I would like to do is set up a module named <code>platform</code> which I can import using <code>platform(project(":platform"))</code> in other modules. Additionally I would like to import a BOM into my platform project using <code>platform("group-id:of-the-bom:and-version")</code>.</p>
  
  <p>An example is the following structure:</p>
  
  <pre class="lang-groovy prettyprint-override"><code>// settings.gradle
  include("platform")
  include("consumer")
  </code></pre>
  
  <pre class="lang-groovy prettyprint-override"><code>// platform/build.gradle
  apply plugin: 'java-platform'
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      constraints {
          api platform("org.wildfly.bom:wildfly-javaee8:15.0.1.Final")
      }
  }
  </code></pre>
  
  <pre class="lang-groovy prettyprint-override"><code>// consumer/build.gradle
  apply plugin: 'java-library'
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      implementation platform(project(":platform"))
      implementation "org.jboss.spec.javax.ejb:jboss-ejb-api_3.2_spec"
  }
  </code></pre>
  
  <p>When I run <code>gradle consumer:dependencies</code> I get output containing the following:</p>
  
  <pre><code>compileClasspath - Compile classpath for source set 'main'.
  +--- project :platform
  \--- org.jboss.spec.javax.ejb:jboss-ejb-api_3.2_spec FAILED
  </code></pre>
  
  <p>It seems as though the <code>platform</code> module is not "re-exporting" constraints which were pulled in through the usage of <code>platform()</code>.</p>
  
  <p>I have found two "workarounds" which don't really solve my problem but seem to indicate that the issue is the usage of <code>platform()</code> together with the <code>java-platform</code> plugin:</p>
  
  <ol>
  <li>Replace <code>implementation platform(project(":platform"))</code> with <code>implementation platform("org.wildfly.bom:wildfly-javaee8:15.0.1.Final")</code> in <code>consumer/build.gradle</code>.</li>
  <li>Put an explicit entry in <code>platform/build.gradle</code> such as <code>api org.jboss.spec.javax.ejb:jboss-ejb-api_3.2_spec:1.0.1.Final</code>.</li>
  </ol>
  
  <p>Is the <code>java-platform</code> plugin not intended to be used in this way, or is there some configuration option I'm missing?</p>