back end/Maven

gradle build error] java.lang.IllegalStateException: endPosTable already set, error: cannot find symbol

노루아부지 2022. 1. 27. 15:07

gradle사용 중 build 할 때 다음과 같은 오류들이 발생하는 경우가 있습니다.

  • java.lang.IllegalStateException: endPosTable already set 
  • error: cannot find symbol public class QClassName

 

이 때 다음과 같이 해결할 수 있습니다.

 

  1. clean을 이용하는 경우
    clean.doLast {
      file(querydslGenratedSrc).deleteDir()
    }​
  2. task를 이용하는 경우
    def querydslGenratedSrc = 'src/main/generated'
    
    task deleteGeneratedSources(type: Delete) {
      delete file(querydslGenratedSrc)
    }
    
    tasks.withType(JavaCompile) { it.dependsOn('deleteGeneratedSources') }​
  3. options으로 처리하는 경우
    tasks.withType(JavaCompile) {
      options.incremental = false
      options.annotationProcessorGeneratedSourcesDirectory = file(querydslGenratedSrc)
    }​
728x90
loading