Workaround for javac compilation order bug in maven

后端 未结 5 2033
栀梦
栀梦 2020-12-09 16:34

I\'m encountering a bug in the Java compiler where the order of files submitted for compilation can cause code not to compile. I\'ve drilled down the code to isolate the sma

5条回答
  •  自闭症患者
    2020-12-09 17:18

    Here's how I would do it:

    • Move the ActionSpec interface to another Maven project. We usually have interfaces and common domain classes in their own project, e.g. foo-service-specs.
    • Keep the other classes in the implementation project, e.g. foo-service-impl.
    • Include the foo-service-specs project as a dependency in foo-service-impl.

    By doing this, you can make sure that the compilation order is working, and it should also work for continuous integration.

提交回复
热议问题