Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapStruct, lombok 混合使用问题 #46

Open
ichengzi opened this issue Aug 10, 2021 · 1 comment
Open

mapStruct, lombok 混合使用问题 #46

ichengzi opened this issue Aug 10, 2021 · 1 comment

Comments

@ichengzi
Copy link
Owner

ichengzi commented Aug 10, 2021

mapstruct/mapstruct#1270 (comment)

Thanks for the nice words. We are glad that you like MapStruct 😄 .

The problem is that you have only mapstruct-processor in the annotationProcessorPaths and only that dependency is passed to the javac compiler.

The annotationProcessorPaths is there only since 3.5 so it is really strange how the mapstruct processor is invoked. In any case in order to make it work correctly you have 2 options:

  1. Add the lombok dependency to the annotationProcessorPaths as well. Then it will be picked up by the compiler and it should work.

  2. Ad the mapstruct-processor jar to your pom as a provided dependency. You will have to remove the annotationProcessorPaths in that case and the compiler will pick up the processors from your dependency. The reason why we are suggesting to use the annotationProcessorPaths is because by doing that you won't be able to use something from the mapstruct-processor module by accident. An additional reason to put it in the pom dependencies is this issue from IntelliJ (in case you are using InteliiJ 😄

You can also have a look at the mapstruct-lombok example from our repository.

I am going to close this issue as it is a problem in the configuration 😄

Originally posted by @filiphr in mapstruct/mapstruct#1270 (comment)

@ichengzi
Copy link
Owner Author

image

1.4.2.Final, jdk8 标记可以直接移除了, 否则maven编译时, 会报找不到 map.struct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant