title: How does Gradle resolve the javaee-api dependency to build an EAR?
body: <p>I see that there's an <code>EAR</code> <a href="https://docs.gradle.org/current/userguide/ear_plugin.html" rel="nofollow noreferrer">plugin</a> for Gradle.  How is it used to build an <code>EAR</code>?  Yes, there's an <code>ear</code> task.  To build an <code>EAR</code> with an <code>EJB</code> module there's a <a href="https://mvnrepository.com/artifact/javax/javaee-api/7.0" rel="nofollow noreferrer">dependency</a> on java-ee.</p>
  
  <p>How is that dependency resolved?  </p>
  
  <p><a href="https://virgo47.wordpress.com/2015/05/13/why-gradle-doesnt-provide-provided/" rel="nofollow noreferrer">https://virgo47.wordpress.com/2015/05/13/why-gradle-doesnt-provide-provided/</a></p>
  
  <p><a href="http://www.lordofthejars.com/2015/10/gradle-and-java-ee.html" rel="nofollow noreferrer">http://www.lordofthejars.com/2015/10/gradle-and-java-ee.html</a></p>
  
  <p><a href="http://www.adam-bien.com/roller/abien/entry/the_only_one_dependency_you" rel="nofollow noreferrer">http://www.adam-bien.com/roller/abien/entry/the_only_one_dependency_you</a></p>
  
  <p>I don't mind reading the fine manual -- just please specify a chapter at least rather than RTFM because the fine manual states:</p>
  
  <blockquote>
    <p>51.4. Dependency management</p>
    
    <p>The Ear plugin adds two dependency configurations: deploy and earlib.
    All dependencies in the deploy configuration are placed in the root of
    the EAR archive, and are not transitive. All dependencies in the
    earlib configuration are placed in the 'lib' directory in the EAR
    archive and are transitive.</p>
  </blockquote>
  
  <p>To my reading that doesn't explain in a concrete fashion how the <code>java-ee</code> dependency itself is resolved.</p>
  
  <p>project (rough):</p>
  
  <pre><code>gradleEAR/
  ├── build.gradle
  ├── gradle
  │   └── wrapper
  │       ├── gradle-wrapper.jar
  │       └── gradle-wrapper.properties
  ├── gradlew
  ├── gradlew.bat
  ├── settings.gradle
  └── src
      ├── main
      │   ├── java
      │   │   └── net
      │   │       └── bounceme
      │   │           └── doge
      │   │               ├── ejb
      │   │               │   ├── NewSessionBean.java
      │   │               │   └── NewSessionBeanRemote.java
      │   │               └── json
      │   │                   ├── JsonReaderClient.java
      │   │                   ├── JsonReader.java
      │   │                   ├── Main.java
      │   │                   ├── Marshaller.java
      │   │                   ├── MarshallJSON.java
      │   │                   ├── ObjectA.java
      │   │                   └── PropertiesReader.java
      │   └── resources
      │       ├── foo.json
      │       ├── json.json
      │       └── properties.properties
      └── test
          └── java
  
  13 directories, 18 files
  </code></pre>
  
  <p>build file (broken dependencies):    </p>
  
  <pre><code>plugins {
      id 'com.gradle.build-scan' version '1.8' 
      id 'java'
      id 'application'
      id 'ear'
  }
  
  mainClassName = 'net.bounceme.doge.json.Main'
  
  buildScan {
      licenseAgreementUrl = 'https://gradle.com/terms-of-service'
      licenseAgree = 'yes'
  }
  
  repositories {
      jcenter()
  }
  
  jar {
      manifest {
          attributes 'Main-Class': 'net.bounceme.doge.json.Main'
      }
  }
  
  task fatJar(type: Jar) {
      baseName = project.name + '-all'
      from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
      with jar
      manifest {
          attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': '3.4.0'
          attributes 'Main-Class': 'net.bounceme.doge.json.Main'
      }
  }
  
  dependencies {
      compile group: 'javax.json', name: 'javax.json-api', version: '1.1'
      compile group: 'org.glassfish', name: 'javax.json', version: '1.1'
  /*
      provided group: 'javax', name: 'javaee-api', version: '7.0'
      provided 'javax:javaee-api:7.0'
      providedCompile 'javax:javaee-api:7.0'
  */
  }
  </code></pre>
  
  <p>Each attempt to resolve the dependency creates different errors.</p>
  
  <p>What's the correct syntax to resolve the <code>javaee-api</code> dependency?  Please do refer me to the manual.</p>