简体   繁体   中英

Flapping compilation error gradle java build

I've never seen anything like this before and have asked everyone at work and they are not sure either. I am getting a compilation error on a ./gradlew assemble build but it does not occur consistently. The error is shown below. What is particularly confusing about this is both AbstractDateRangeConfig and DynamicRequestComponent are used throughout the code base in other classes and these compile fine consistently. DynamicRequestComponent is a spring annotation the other class is an internal class. There is another class with an almost identical setup, the only difference I can see is that there is also an inner class with a @Configuration annotation in the class which fails compilation. Does anyone have any suggestion on what might cause a flapping compilation error like this?

:frontend:compileJava/mnt/jenkins/workspace/frontend/src/main/java/com/frontend/app/controller/group/forecast/NewGroupForecastReport.java:358: error: cannot find symbol
    public static class NewGroupForecastReportConfig extends AbstractDateRangedConfig {
                                                             ^
  symbol:   class AbstractDateRangedConfig
  location: class NewGroupForecastReport
/mnt/jenkins/workspace/duetto_app_basic2/frontend/src/main/java/com/frontend/app/controller/group/forecast/NewGroupForecastReport.java:357: error: cannot find symbol
    @DynamicRequestComponent
     ^
  symbol:   class DynamicRequestComponent
  location: class NewGroupForecastReport
2 errors
 FAILED

Edit: It is not the @Configuration annotation causing it. I removed that part of the code and still see the error

Appears to be resolved by pulling out the inner class into a separate class file. Believe the error had something to do with the way Spring scans for annotations

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM