title: how to exclude a folder from checkstyle of Gradle on Intellij
body: <p>I am new for IntelliJ and Gradle, but I have enough experience on Java and Eclipse. I generated some java classes from wsdl file. I put them under <code>src/main/resources</code> with a folder name - "generatedsources".</p>
  
  <p>I try to prevent checkstyle for this folder and its subfolders like <code>src/main/resources/generatedsources/*</code> with gradle on IntelliJ.</p>
  
  <p>I tried some lines such;</p>
  
  <pre><code>task checkstyle(type: Checkstyle) {
          source 'src'
      //    include '**/*.java'
      //    exclude '**/gen/**'
      //    exclude '**/R.java'
      //    exclude '**/BuildConfig.java'
          exclude 'src/main/resources/generatedsources/**'
      }
  </code></pre>
  
  <p>But I'm failed again.</p>
  
  <p>build.gradle;</p>
  
  <pre><code>apply plugin: 'war'
  apply plugin: 'jetty'
  apply plugin: 'checkstyle'
  apply plugin: 'java'
  apply plugin: 'no.nils.wsdl2java'
  
  sourceCompatibility = 1.7
  version = '1.0'    
  
  ...
  
  buildscript{
      repositories{
          jcenter()
          mavenCentral()
      }
      dependencies {
          classpath 'no.nils:wsdl2java:0.10'
      }
  }
  
  task checkstyle(type: Checkstyle) {
      source 'src'
  //    include '**/*.java'
  //    exclude '**/gen/**'
  //    exclude '**/R.java'
  //    exclude '**/BuildConfig.java'
      exclude 'src/main/resources/generatedsources/**'
  }
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT - After recommendations(but still failed!):</strong></p>
  
  <pre><code>apply plugin: 'war'
  apply plugin: 'jetty'
  apply plugin: 'checkstyle'
  apply plugin: 'java'
  apply plugin: 'no.nils.wsdl2java'
  
  sourceCompatibility = 1.7
  version = '1.0'
  
  description = """BLABLABLA_application"""
  
  war.archiveName = "BLABLABLA.war"
  
  configurations{
      deployerJars
  }
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      compile group: 'org.codehaus.jackson', name: 'jackson-core-asl', version: '1.9.3'
      compile group: 'org.codehaus.jackson', name: 'jackson-mapper-asl', version: '1.9.3'
      compile group: 'org.springframework', name: 'spring-core', version:'4.0.0.RELEASE'
      compile group: 'org.springframework', name: 'spring-web', version:'4.0.0.RELEASE'
      compile 'log4j:log4j:1.2.17'
      compile 'com.sun.xml.ws:jaxws-rt:2.2.8'
      compile 'org.jvnet.jax-ws-commons.spring:jaxws-spring:1.9'
      compile group: 'org.springframework', name: 'spring-webmvc', version:'4.0.0.RELEASE'
      providedCompile group: 'javax.servlet', name: 'servlet-api', version:'2.5'
      testCompile group: 'junit', name: 'junit', version: '4.11'
      deployerJars "org.apache.maven.wagon:wagon-http:2.2"
  }
  
  jar {
      manifest {
          attributes 'Implementation-Title': 'BLABLABLA', 'Implementation-Version': version
      }
  }
  
  uploadArchives {
      repositories {
          flatDir {
              dirs 'repos'
          }
      }
  }
  
  
  buildscript{
      repositories{
          jcenter()
          mavenCentral()
      }
      dependencies {
          classpath 'no.nils:wsdl2java:0.10'
      }
  }
  
  wsdl2java{
      wsdlsToGenerate = [
              ["$projectDir/src/main/resources/BLABLABLA.wsdl"]
      ]
      generatedWsdlDir = file("$projectDir/src/gen/java")
      wsdlDir = file("$projectDir/src/main/resources")
  }
  
  wsdl2javaExt {
      cxfVersion = "2.5.1"
  }
  
  tasks.withType(Checkstyle) {
      exclude '**/your/generated/package/goes/here**'
  }
  
  checkstyleMain.exclude '**/your/generated/package/goes/here**'
  </code></pre>
  
  <p>"exclude" in tasks.withType and "checkstyleMain" causes an error such as "cannot resolve symbol"!</p>