From d4eb3fe2904cf29195df9246f8dcb925c5583b1b Mon Sep 17 00:00:00 2001 From: Gunnar Morling Date: Tue, 15 Mar 2016 22:19:10 +0100 Subject: [PATCH] #769 Updating set-up description to make use of Maven compiler plug-in --- .../mapstruct-reference-guide.asciidoc | 82 ++++++++++--------- 1 file changed, 45 insertions(+), 37 deletions(-) diff --git a/documentation/src/main/asciidoc/mapstruct-reference-guide.asciidoc b/documentation/src/main/asciidoc/mapstruct-reference-guide.asciidoc index beede4d28..8c967ec90 100644 --- a/documentation/src/main/asciidoc/mapstruct-reference-guide.asciidoc +++ b/documentation/src/main/asciidoc/mapstruct-reference-guide.asciidoc @@ -63,39 +63,38 @@ For Maven based projects add the following to your POM file in order to use MapS - org.bsc.maven - maven-processor-plugin - 2.2.4 + org.apache.maven.plugins + maven-compiler-plugin + 3.5.1 - - ${project.build.directory}/generated-sources - - - org.mapstruct.ap.MappingProcessor - + 1.8 + 1.8 + + + org.mapstruct + mapstruct-processor + ${org.mapstruct.version} + + - - - process - generate-sources - - process - - - - - - org.mapstruct - mapstruct-processor - ${org.mapstruct.version} - - +... ---- ==== +[TIP] +==== +If you are working with the Eclipse IDE, make sure to have a current version of the http://www.eclipse.org/m2e/[M2E plug-in]. +When importing a Maven project configured as shown above, it will set up the MapStruct annotation processor so it runs right in the IDE, whenever you save a mapper type. +Neat, isn't it? + +To double check that everything is working as expected, go to your project's properties and select "Java Compiler" -> "Annotation Processing" -> "Factory Path". +The MapStruct processor JAR should be listed and enabled there. +Any processor options configured via the compiler plug-in (see below) should be listed under "Java Compiler" -> "Annotation Processing". +==== + [[configuration-options]] === Configuration options @@ -110,20 +109,29 @@ When invoking javac directly, these options are passed to the compiler in the fo ---- ... - org.bsc.maven - maven-processor-plugin + org.apache.maven.plugins + maven-compiler-plugin + 3.5.1 - - org.mapstruct.ap.MappingProcessor - - - true - cdi - - ... + 1.8 + 1.8 + + + org.mapstruct + mapstruct-processor + ${org.mapstruct.version} + + + + + -Amapstruct.suppressGeneratorTimestamp=true + + + -Amapstruct.suppressGeneratorVersionInfoComment=true + + - ... - + ... ---- ====