title: Can't use generated classes from build folder with IntelliJ Idea and Gradle
body: <p>I'm trying to follow this guide (consuming a SOAP web service) with <strong>IntelliJ Idea</strong> and <strong>Gradle</strong> - <a href="https://spring.io/guides/gs/consuming-web-service/#initial" rel="nofollow noreferrer">https://spring.io/guides/gs/consuming-web-service/#initial</a></p>
  <p>I already have SOAP-server, it's working fine and I can see my WSDL on my localhost.</p>
  <p>I repeated every step in the guide, but when it comes to &quot;Create a [...] Service Client&quot; I ran into some problems. I do have a folder named &quot;generated-sources&quot; and it contains my classes, generated from WSDL. But I can't use these classes in &quot;Service Client&quot; (seems like Idea can't see them).</p>
  <p>Here is my <strong>build.gradle</strong>:</p>
  <pre><code>plugins {
      id 'org.springframework.boot' version '2.2.0.RELEASE'
      id 'io.spring.dependency-management' version '1.0.8.RELEASE'
      id 'java'
  }
  
  group = 'com.example'
  version = '0.0.1-SNAPSHOT'
  sourceCompatibility = '11'
  
  configurations {
      jaxb
  }
  
  repositories {
      mavenCentral()
  }
  
  task genJaxb {
      ext.sourcesDir = &quot;${buildDir}/generated-sources/jaxb&quot;
      ext.classesDir = &quot;${buildDir}/classes/jaxb&quot;
      ext.schema = &quot;http://localhost:8080/ws/author.wsdl&quot;
  
      outputs.dir classesDir
  
      doLast() {
          project.ant {
              taskdef name: &quot;xjc&quot;, classname: &quot;com.sun.tools.xjc.XJCTask&quot;,
                      classpath: configurations.jaxb.asPath
              mkdir(dir: sourcesDir)
              mkdir(dir: classesDir)
  
              xjc(destdir: sourcesDir, schema: schema,
                      package: &quot;com.example.consumingwebservice.wsdl&quot;) {
                  arg(value: &quot;-wsdl&quot;)
                  produces(dir: sourcesDir, includes: &quot;**/*.java&quot;)
              }
  
              javac(destdir: classesDir, source: 11, target: 11, debug: true,
                      debugLevel: &quot;lines,vars,source&quot;,
                      classpath: configurations.jaxb.asPath) {
                  src(path: sourcesDir)
                  include(name: &quot;**/*.java&quot;)
                  include(name: &quot;*.java&quot;)
              }
  
              copy(todir: classesDir) {
                  fileset(dir: sourcesDir, erroronmissingdir: false) {
                      exclude(name: &quot;**/*.java&quot;)
                  }
              }
          }
      }
  }
  
  dependencies {
  
      implementation ('org.springframework.boot:spring-boot-starter-web-services') {
          exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
      }
      implementation 'org.springframework.ws:spring-ws-core'
      // For Java 11:
      implementation 'org.glassfish.jaxb:jaxb-runtime'
      compile(files(genJaxb.classesDir).builtBy(genJaxb))
  
      jaxb &quot;com.sun.xml.bind:jaxb-xjc:2.1.7&quot;
  
      testImplementation('org.springframework.boot:spring-boot-starter-test') {
          exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
      }
  }
  
  test {
      useJUnitPlatform()
  }
  
  bootJar {
      baseName = 'gs-consuming-web-service'
      version =  '0.0.1'
  }
  </code></pre>
  <p>And this is my <strong>screenshot</strong> - <a href="https://img.techpowerup.org/200624/2687.jpg" rel="nofollow noreferrer">https://img.techpowerup.org/200624/2687.jpg</a></p>
  <p>Alt + Enter offers to create new class, and import leads to this: img.techpowerup.org/200624/2344.jpg</p>
  <p>I will be very grateful for any help.</p>