title: Gradle Project Structure
body: <p>I am working on selenium Gradle project in which I accidentally changed some configuration that causes changes in build structure.  before change my project structure was </p>
  
  <p>project-dir</p>
  
  <ul>
  <li>.gradle</li>
  <li>.idea</li>
  <li><strong>build</strong></li>
  <li>gradle</li>
  <li>out</li>
  <li>src</li>
  </ul>
  
  <p>now its </p>
  
  <p>project-dir</p>
  
  <ul>
  <li>.gradle</li>
  <li>.idea</li>
  <li><strong>classes</strong></li>
  <li>gradle</li>
  <li>out</li>
  <li>src</li>
  </ul>
  
  <p>when I run command "gradlew build" it should run all the feature files but it is not working after change. can you help me what went wrong. I am new to all this.</p>
  
  <p>I am using
  gradle 4.12
  selenium 2.53.0
  cucumber-junit 1.2.5
  cucumber-java 1.2.5
  cucumber-core 1.2.5</p>
  
  <p>Gradle.build file:</p>
  
  <p>-</p>
  
  <pre><code>import java.text.DateFormat
  
  import java.text.SimpleDateFormat
  
  version '1.0-SNAPSHOT'
  
  task gitBuildId {
  
      description = "Determine the build id from git"
      def buildIdOut = new ByteArrayOutputStream()
      def errorsOut = new ByteArrayOutputStream()
      def extraInfo = ""
      try {
          exec {
              // TODO: use a java git library?
              standardOutput = buildIdOut
              errorOutput = errorsOut
              commandLine 'git', 'log', '-1', '--pretty=format:%ct|%h', 'HEAD'
          }
      } catch (Exception e) {
          buildIdOut.write('0'.getBytes())
          if (errorsOut.toString().contains("Not a git repository")) {
              extraInfo = "(Not a git repository and/or no commits found)\n" +
                      "Type: git init; git add *; git commit *;"
          }
      }
      //OR? def buildIdOut = (long) ((new Date()).getTime() / 1000)
      DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss")
      df.setTimeZone(TimeZone.getTimeZone("GMT"))
  
      //split into hash and timestamp
      String[] parts = buildIdOut.toString().split("\\|")
      def inTimeStamp = Long.parseLong(parts[0])
      def date = new Date((inTimeStamp as long) * 1000)
      def dateString = df.format(date)
      def buildId = "${dateString}.${parts[1]}"
      println "buildId = ${buildId} ${extraInfo}"
      ext.output = {
          return buildId
      }
  }
  
  if (JavaVersion.current().isJava8Compatible()) {
      allprojects {
          tasks.withType(Javadoc) {
              options.addStringOption('Xdoclint:none', '-quiet')
          }
      }
  }
  
  //def buildId = rootProject.tasks.gitBuildId.output()
  def rpmVersion = '0.0.0'
  //apply plugin: 'java'
  //apply plugin: 'gradle-one-jar'
  apply plugin: 'application'
  //apply plugin: 'idea'
  
  sourceCompatibility = 1.8
  
  // UTF-8 should be standard by now. So use it!
  [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
  
  mainClassName = 'cucumber.api.cli.Main'
  
  // Add Gradle OneJar Plugin, see https://github.com/rholder/gradle-one-jar
  buildscript {
      repositories {
          mavenCentral()
      }
  }
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      testCompile group: 'junit', name: 'junit', version: '4.12'
      testCompile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '2.53.0'
      testCompile group: 'info.cukes', name: 'cucumber-junit', version: '1.2.5'
      testCompile group: 'info.cukes', name: 'cucumber-java', version: '1.2.5'
      testCompile group: 'info.cukes', name: 'cucumber-core', version: '1.2.5'
      testCompile group: 'info.cukes', name: 'cucumber-jvm-deps', version: '1.0.3'
      testCompile group: 'info.cukes', name: 'gherkin', version: '2.7.3'
      testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.8'
      testCompile group: 'com.mashape.unirest', name: 'unirest-java', version: '1.4.9'
      testCompile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.3.6'
      testCompile group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.0.2'
      testCompile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.3.6'
      testCompile group: 'org.json', name: 'json', version: '20140107'
  
  
  
      compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.6'
      compile group: 'info.cukes', name: 'cucumber-junit', version: '1.2.5'
      compile group: 'info.cukes', name: 'cucumber-java', version: '1.2.5'
      compile group: 'info.cukes', name: 'cucumber-core', version: '1.2.5'
      compile group: 'info.cukes', name: 'cucumber-jvm-deps', version: '1.0.3'
  }
  
  // Configure the oneJar task
  task oneJar() {
      doLast {
          mainClass = mainClassName
      }
  }
  
  //def buildId = rootProject.tasks.gitBuildId.output()
  
  allprojects {
  
      apply plugin: 'java'
      apply plugin: 'maven'
      apply plugin: 'signing'
      apply plugin: 'application'
  
      mainClassName = 'cucumber.api.cli.Main'
  
      // IDE support
      apply from: rootProject.file('gradle/ide.gradle')
  
      //cucumber support
      //apply from: rootProject.file('gradle/cucumber.gradle')
  
      if (version == 'unspecified') {
          version = '0.0.0'
  
          def envVersion = System.env['VERSION']
          if (envVersion) {
              version = envVersion
          }
      }
  
      distZip.doFirst {
          copy {
              from('bin') {
                  include '**/*'
              }
              into file("src/dist/bin")
              fileMode = 0755
          }
      }
  }
  
  task deleteTestResults() {
      delete "build/test-results/test/"
      delete "cucumber-html-reports"
  }
  
  
  /*task cucumberTest() {
  
      def arglist = ["--monochrome", "--plugin", "pretty", "--glue", "com.automation.server",
                     "src/test/resources/features/"]
  
      return javaexec {
          main = "cucumber.api.cli.Main"
          classpath = sourceSets.main.runtimeClasspath
          args = arglist
      }
  }*/
  
  test {
      //we want display the following test events
      testLogging {
          events "PASSED", "STARTED", "FAILED", "SKIPPED"
          //showStandardStreams = true
      }
  }
  
  task testBoth {
  
      println 'This is executed last during the execution phase.'
  }
  
  task wrapper(type: Wrapper) {
      gradleVersion = '4.0'
  }
  artifacts {
      oneJar
  }
  </code></pre>