How to get Eclipse to generate MapStruct Mappers using Gradle

后端 未结 1 585
无人及你
无人及你 2021-01-13 15:05

Is there any special copnfiguration to get eclipse to generate the Mapstruct mappers? Curently they are not being generated.

They do generate in a gradle build but I

相关标签:
1条回答
  • 2021-01-13 16:00

    So after a bit of searching I determined that the solution is that you have to manually run the eclipse task in gradle. You should then see similar to the following if it is successful:

    The solution came from reading https://github.com/tbroyer/gradle-apt-plugin docs which states:

    When using Buildship, you'll have to manually run the eclipseJdtApt and eclipseFactorypath tasks to generate the Eclipse configuration files, then either run the eclipseJdt task or manually enable annotation processing: in the project properties → Java Compiler → Annotation Processing, check Enable Annotation Processing. Note that while all those tasks are depended on by the eclipse task, that one is incompatible with Buildship, so you have to explicitly run the two or three aforementioned tasks and not run the eclipse task.

    It states that the eclipse task is incompatible with buildship but that seems to be fixed (I ran the eclipse task and had no issues):

    I did however have issues with the cleanEclipse task which does seem to be incompatible with Buildship.

    After all this the *MapperImpl.java classes are generated in <project_root>/.apt_generated

    0 讨论(0)
提交回复
热议问题