title: why "jar.enabled = false" affects dependencies in Gradle?
body: <p>The story:
  I have recently discovered that setting <code>jar.enabled = false</code> in project b-features of a multi-projects Gradle project will stop project a-features of the same project from being able to refer to B via </p>
  
  <pre><code>dependencies {
      compile project(':b-features')
  }
  </code></pre>
  
  <p>The question: 
  Why is <code>jar.enabled = false</code> stopping project A from successfully referring to project B? </p>
  
  <p>Additional info:</p>
  
  <p>build.gradle of the root project:</p>
  
  <pre><code>group 'gradle.studies'
  apply plugin: 'java'
  ...
  </code></pre>
  
  <p>settings.gradle of the root project:</p>
  
  <pre><code>rootProject.name = 'multi-project-reference'
  include 'a-features'
  include 'b-features'
  </code></pre>
  
  <p>build.gradle of the project <code>a-features</code>:</p>
  
  <pre><code>group 'gradle.studies'
  apply plugin: 'java'
  ...
  dependencies {
      compile project(':b-features')
  }
  ...
  </code></pre>
  
  <p>build.gradle of the project <code>b-features</code></p>
  
  <pre><code>group 'gradle.studies'   
  apply plugin: 'java'    
  jar.enabled = false    
  ...
  </code></pre>
  
  <p>Class A in <code>a-features</code> project:</p>
  
  <pre><code>package outerproject;
  
  import innerproject.B;
  
  public class A {
      public static void main(String[] args) {
          B b = new B();
          System.out.println(b.getMsg());
      }
  }
  </code></pre>
  
  <p>Class B in <code>b-features</code> project:</p>
  
  <pre><code>package innerproject;
  public class B {
  
      public B() {
          this.msg = "Hello World";
      }
  
      private String msg;
  
      public String getMsg() {
          return msg;
      }
      //...
  }
  </code></pre>
  
  <p><strong>The error:</strong></p>
  
  <pre><code>14:27:50: Executing external task 'build'...
  :compileJava NO-SOURCE :processResources NO-SOURCE :classes UP-TO-DATE
  :jar UP-TO-DATE :assemble UP-TO-DATE :compileTestJava NO-SOURCE
  :processTestResources NO-SOURCE :testClasses UP-TO-DATE :test
  NO-SOURCE :check UP-TO-DATE :build UP-TO-DATE :b-features:compileJava
  UP-TO-DATE :b-features:processResources NO-SOURCE :b-features:classes
  UP-TO-DATE :b-features:jar SKIPPED
  /home/nikita/IdeaProjects/multi-project-reference/a-features/src/main/java/outerproject/A.java:3:
  error: package innerproject does not exist import innerproject.B;
                     ^ /home/nikita/IdeaProjects/multi-project-reference/a-features/src/main/java/outerproject/A.java:7:
  error: cannot find symbol
          B b = new B();
          ^   symbol:   class B   location: class A /home/nikita/IdeaProjects/multi-project-reference/a-features/src/main/java/outerproject/A.java:7:
  error: cannot find symbol
          B b = new B();
                    ^   symbol:   class B   location: class A 3 errors :a-features:compileJava FAILED
  
  FAILURE: Build failed with an exception.
  </code></pre>