title: Don't see all gradle tasks when run on Jenkins
body: <p>I am working on an <code>xtext</code> project with Gradle as a build system. I want to run <code>gradlew war</code> in Jenkins, however, it is not available for some reason. When I run <code>gradlew tasks</code> to see all the available options, it is not listed there. These are available tasks:</p>
  
  <pre><code>Build Setup tasks
  -----------------
  init - Initializes a new Gradle build.
  wrapper - Generates Gradle wrapper files.
  
  Help tasks
  ----------
  buildEnvironment - ...
  ...
  </code></pre>
  
  <p>But when I run it locally on my machine there are far more tasks available:</p>
  
  <pre><code>Build tasks
  -----------
  ...
  war - Generates a war archive with all the compiled classes, the web-app content and the libraries.
  
  Build Setup tasks
  -----------------
  init - Initializes a new Gradle build.
  wrapper - Generates Gradle wrapper files.
  
  Documentation tasks
  -------------------
  javadoc - Generates Javadoc API documentation for the main source code.
  
  Help tasks
  ----------
  ...
  
  IDE tasks
  ---------
  ...
  
  Run tasks
  ---------
  jettyRun - Starts an example Jetty server with your language
  
  Verification tasks
  ------------------
  check - Runs all checks.
  test - Runs the unit tests.
  </code></pre>
  
  <p>So <code>war</code> task is clearly there and I can run it without any issues. Why Jenkins doesn't see it then. I haven't modified any Gradle files. All contain default code created with the project. I can append any Gradle file if needed, but I do not know which one might be needed. This is however main <code>build.gradle</code> file (there are more in subdirectories:</p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'org.xtext:xtext-gradle-plugin:2.0.4'
      }
  }
  
  subprojects {
      ext.xtextVersion = '2.17.0'
      repositories {
          jcenter()
      }
  
      apply plugin: 'java'
      dependencies {
          compile platform("org.eclipse.xtext:xtext-dev-bom:${xtextVersion}")
      }
  
      apply plugin: 'org.xtext.xtend'
      apply from: "${rootDir}/gradle/source-layout.gradle"
      apply plugin: 'eclipse'
  
      group = 'ic.ac.uk.mydsl'
      version = '1.0.0-SNAPSHOT'
  
      sourceCompatibility = '1.8'
      targetCompatibility = '1.8'
  
      configurations.all {
          exclude group: 'asm'
      }
  }
  </code></pre>
  
  <p>EDIT:
  Image of my parent directory in git repo:
  <a href="https://i.stack.imgur.com/rrOi9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rrOi9.png" alt="enter image description here"></a></p>