{"action":"created","issue":{"url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1581","repository_url":"https://api.github.com/repos/mapstruct/mapstruct","labels_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1581/labels{/name}","comments_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1581/comments","events_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1581/events","html_url":"https://github.com/mapstruct/mapstruct/issues/1581","id":349314183,"node_id":"MDU6SXNzdWUzNDkzMTQxODM=","number":1581,"title":"Ordering of mapstruct and lombok gradle annotationProcessor seems to matter","user":{"login":"kaweston","id":2409399,"node_id":"MDQ6VXNlcjI0MDkzOTk=","avatar_url":"https://avatars3.githubusercontent.com/u/2409399?v=4","gravatar_id":"","url":"https://api.github.com/users/kaweston","html_url":"https://github.com/kaweston","followers_url":"https://api.github.com/users/kaweston/followers","following_url":"https://api.github.com/users/kaweston/following{/other_user}","gists_url":"https://api.github.com/users/kaweston/gists{/gist_id}","starred_url":"https://api.github.com/users/kaweston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaweston/subscriptions","organizations_url":"https://api.github.com/users/kaweston/orgs","repos_url":"https://api.github.com/users/kaweston/repos","events_url":"https://api.github.com/users/kaweston/events{/privacy}","received_events_url":"https://api.github.com/users/kaweston/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-09T22:30:23Z","updated_at":"2018-08-18T08:47:04Z","closed_at":null,"author_association":"NONE","body":"In a work project I have to ensure that the lombok annotationProcessor directive is listed after mapstruct otherwise various errors occur.  Identical behaviour whether running gradle from command line or via the gradle window in Intellij.\r\n\r\n// Good setup\r\ndependencies {\r\n   compile(\"org.mapstruct:mapstruct-jdk8\")\r\n\r\n    annotationProcessor(\"au.com.agic.api:commons-mapping\")\r\n    annotationProcessor(\"org.mapstruct:mapstruct-processor\")\r\n    annotationProcessor(\"org.projectlombok:lombok\") <<=== Lombok after mapstruct\r\n\r\n    testAnnotationProcessor(\"au.com.agic.api:commons-mapping\")\r\n    testAnnotationProcessor(\"org.mapstruct:mapstruct-processor\")\r\n    testAnnotationProcessor(\"org.projectlombok:lombok\")\r\n\r\n    // Other dependencies\r\n\r\n}\r\n\r\n// Error setup\r\n dependencies {\r\n   compile(\"org.mapstruct:mapstruct-jdk8\")\r\n\r\n   annotationProcessor(\"org.projectlombok:lombok\") <<=== Lombok before mapstruct\r\n    annotationProcessor(\"au.com.agic.api:commons-mapping\")\r\n    annotationProcessor(\"org.mapstruct:mapstruct-processor\")\r\n   \r\n   testAnnotationProcessor(\"org.projectlombok:lombok\")\r\n    testAnnotationProcessor(\"au.com.agic.api:commons-mapping\")\r\n    testAnnotationProcessor(\"org.mapstruct:mapstruct-processor\")\r\n    \r\n\r\n    // Other dependencies\r\n\r\n}\r\n\r\nSample of errors encountered.  Not sure if this matters but both TravelWhatIfPrice and ContactDetails use lombok Builder annotations although the Builder class are already defined without methods so that I can use the Jackson library's @JsonPOJOBuilder(withPrefix=\"\") annotation to match with lombok's setter naming convention.\r\n\r\n......CsApi2TravelWhatIfPricesMapper.java:11: error: au.com.agic.api.travel.domain.TravelWhatIfPrice does not have an accessible parameterless constructor.\r\n    TravelWhatIfPrice toModel(final CsApi2TravelWhatIfPrice csApi2TravelWhatIfPrice);\r\n\r\n....... CsApi2ContactDetailsMapper.java:23: error: Property \"id\" has no write accessor in au.com.agic.api.travel.domain.ContactDetails.\r\n    @Mapping(target = \"id\", source = \"id\")\r\n"},"comment":{"url":"https://api.github.com/repos/mapstruct/mapstruct/issues/comments/414042588","html_url":"https://github.com/mapstruct/mapstruct/issues/1581#issuecomment-414042588","issue_url":"https://api.github.com/repos/mapstruct/mapstruct/issues/1581","id":414042588,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDA0MjU4OA==","user":{"login":"filiphr","id":6012094,"node_id":"MDQ6VXNlcjYwMTIwOTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/6012094?v=4","gravatar_id":"","url":"https://api.github.com/users/filiphr","html_url":"https://github.com/filiphr","followers_url":"https://api.github.com/users/filiphr/followers","following_url":"https://api.github.com/users/filiphr/following{/other_user}","gists_url":"https://api.github.com/users/filiphr/gists{/gist_id}","starred_url":"https://api.github.com/users/filiphr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filiphr/subscriptions","organizations_url":"https://api.github.com/users/filiphr/orgs","repos_url":"https://api.github.com/users/filiphr/repos","events_url":"https://api.github.com/users/filiphr/events{/privacy}","received_events_url":"https://api.github.com/users/filiphr/received_events","type":"User","site_admin":false},"created_at":"2018-08-18T08:47:04Z","updated_at":"2018-08-18T08:47:04Z","author_association":"MEMBER","body":"The order should not matter. However, I think that the problem with the builders is https://github.com/rzwitserloot/lombok/issues/1538. During compilation we can't see the builder and the builder methods from Lombok. If you split the Lombok and MapSruct mappers into 2 different modules then it is going to work. You can chime in on the linked Lombok issue.\r\n\r\nWhat do you mean with\r\n\r\n>Builder class are already defined without methods so that I can use the Jackson library's @JsonPOJOBuilder(withPrefix=\"\") annotation to match with lombok's setter naming convention."}}
{"actor":{"display_login":"filiphr"}}