<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Can we configure project-build-plugin to use annotation processor?</title><link>https://answers.axonivy.com/questions/3146/can-we-configure-project-build-plugin-to-use-annotation-processor</link><description>&lt;p&gt;Hi ivyteam&lt;/p&gt;
&lt;p&gt;As you know that in order to compile ivy project, we need to use project-build-plugin which has been developed by ivyteam. &lt;/p&gt;
&lt;p&gt;There is a case that when i use third party, they have a custom compiler by annotation processor. There is available in &lt;a href="https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessorPaths"&gt;maven-compiler-plugin&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Example:
&lt;img alt="alt text" src="https://answers.axonivy.com/upfiles/Untitled2_wotN1IK.png"&gt;&lt;/p&gt;
&lt;p&gt;My question is: Can we configure project-build-plugin for this config?&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/3146/can-we-configure-project-build-plugin-to-use-annotation-processor" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 23 Mar 2018 04:59:19 -0400</lastBuildDate><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/3146/can-we-configure-project-build-plugin-to-use-annotation-processor/3149</link><description>&lt;p&gt;Yet it is not possible to pass annotation processing parameters to the project-build-plugin. But it would be a simple thing to support it. We almost had it, but dropped it then as it was no solution for the need back then, when we tried to support lombok: &lt;a href="https://jira.axonivy.com/jira/browse/XIVY-1606"&gt;https://jira.axonivy.com/jira/browse/XIVY-1606&lt;/a&gt;
You may enrich that existing issue with your use case + demo project for mapstruct and I can verify if we could support your scenario.&lt;/p&gt;
&lt;p&gt;Theoretically the JDT compiler that is used by the project-build-plugin supports annotation processing. So it should be a simple improvement to support it. But yet there is no interface for project-build-plugin users:&lt;/p&gt;
&lt;p&gt;Just for fun. Here is the list of possible compiler flags. The &lt;code&gt;-processor&lt;/code&gt; flag seems relevant in this case...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Eclipse Compiler for Java(TM) v20150120-1634, 3.10.2
Copyright IBM Corp 2000, 2013. All rights reserved.

 Usage: &amp;lt;options&amp;gt; &amp;lt;source files | directories&amp;gt;
 If directories are specified, then their source contents are compiled.
 Possible options are listed below. Options enabled by default are prefixed
 with '+'.

 Classpath options:
    -cp -classpath &amp;lt;directories and ZIP archives separated by :&amp;gt;
                       specify location for application classes and sources.
                       Each directory or file can specify access rules for
                       types between '[' and ']' (e.g. [-X] to forbid
                       access to type X, [~X] to discourage access to type X,
                       [+p/X:-p/*] to forbid access to all types in package p
                       but allow access to p/X)
    -bootclasspath &amp;lt;directories and ZIP archives separated by :&amp;gt;
                       specify location for system classes. Each directory or
                       file can specify access rules for types between '['
                       and ']'
    -sourcepath &amp;lt;directories and ZIP archives separated by :&amp;gt;
                       specify location for application sources. Each directory
                       or file can specify access rules for types between '['
                       and ']'. Each directory can further specify a specific
                       destination directory using a '-d' option between '['
                       and ']'; this overrides the general '-d' option.
                       .class files created from source files contained in a
                       jar file are put in the user.dir folder in case no
                       general '-d' option is specified. ZIP archives cannot
                       override the general '-d' option
    -extdirs &amp;lt;directories separated by :&amp;gt;
                       specify location for extension ZIP archives
    -endorseddirs &amp;lt;directories separated by :&amp;gt;
                       specify location for endorsed ZIP archives
    -d &amp;lt;dir&amp;gt;           destination directory (if omitted, no directory is
                       created); this option can be overridden per source
                       directory
    -d none            generate no .class files
    -encoding &amp;lt;enc&amp;gt;    specify default encoding for all source files. Each
                       file/directory can override it when suffixed with
                       '['&amp;lt;enc&amp;gt;']' (e.g. X.java[utf8]).
                       If multiple default encodings are specified, the last
                       one will be used.

 Compliance options:
    -1.3               use 1.3 compliance (-source 1.3 -target 1.1)
    -1.4             + use 1.4 compliance (-source 1.3 -target 1.2)
    -1.5 -5 -5.0       use 1.5 compliance (-source 1.5 -target 1.5)
    -1.6 -6 -6.0       use 1.6 compliance (-source 1.6 -target 1.6)
    -1.7 -7 -7.0       use 1.7 compliance (-source 1.7 -target 1.7)
    -1.8 -8 -8.0       use 1.8 compliance (-source 1.8 -target 1.8)
    -source &amp;lt;version&amp;gt;  set source level: 1.3 to 1.8 (or 5, 5.0, etc)
    -target &amp;lt;version&amp;gt;  set classfile target: 1.1 to 1.8 (or 5, 5.0, etc)
                       cldc1.1 can also be used to generate the StackMap
                       attribute

 Warning options:
    -deprecation     + deprecation outside deprecated code (equivalent to
                       -warn:+deprecation)
    -nowarn -warn:none disable all warnings
    -nowarn:[&amp;lt;directories separated by :&amp;gt;]
                       specify directories from which optional problems should
                       be ignored
    -?:warn -help:warn display advanced warning options

 Error options:
    -err:&amp;lt;warnings separated by ,&amp;gt;    convert exactly the listed warnings
                                      to be reported as errors
    -err:+&amp;lt;warnings separated by ,&amp;gt;   enable additional warnings to be
                                      reported as errors
    -err:-&amp;lt;warnings separated by ,&amp;gt;   disable specific warnings to be
                                      reported as errors

 Setting warning or error options using properties file:
    -properties &amp;lt;file&amp;gt;   set warnings/errors option based on the properties
                          file contents. This option can be used with -nowarn,
                          -err:.. or -warn:.. options, but the last one on the
                          command line sets the options to be used.

 Debug options:
    -g[:lines,vars,source] custom debug info
    -g:lines,source  + both lines table and source debug info
    -g                 all debug info
    -g:none            no debug info
    -preserveAllLocals preserve unused local vars for debug purpose

 Annotation processing options:
   These options are meaningful only in a 1.6 environment.
    -Akey[=value]        options that are passed to annotation processors
    -processorpath &amp;lt;directories and ZIP archives separated by :&amp;gt;
                         specify locations where to find annotation processors.
                         If this option is not used, the classpath will be
                         searched for processors
    -processor &amp;lt;class1[,class2,...]&amp;gt;
                         qualified names of the annotation processors to run.
                         This bypasses the default annotation discovery process
    -proc:only           run annotation processors, but do not compile
    -proc:none           perform compilation but do not run annotation
                         processors
    -s &amp;lt;dir&amp;gt;             destination directory for generated source files
    -XprintProcessorInfo print information about which annotations and elements
                         a processor is asked to process
    -XprintRounds        print information about annotation processing rounds
    -classNames &amp;lt;className1[,className2,...]&amp;gt;
                         qualified names of binary classes to process

 Advanced options:
    @&amp;lt;file&amp;gt;            read command line arguments from file
    -maxProblems &amp;lt;n&amp;gt;   max number of problems per compilation unit (100 by
                       default)
    -log &amp;lt;file&amp;gt;        log to a file. If the file extension is '.xml', then
                       the log will be a xml file.
    -proceedOnError[:Fatal]
                       do not stop at first error, dumping class files with
                       problem methods
                       With ":Fatal", all optional errors are treated as fatal
    -verbose           enable verbose output
    -referenceInfo     compute reference info
    -progress          show progress (only in -log mode)
    -time              display speed information 
    -noExit            do not call System.exit(n) at end of compilation (n==0
                       if no error)
    -repeat &amp;lt;n&amp;gt;        repeat compilation process &amp;lt;n&amp;gt; times for perf analysis
    -inlineJSR         inline JSR bytecode (implicit if target &amp;gt;= 1.5)
    -enableJavadoc     consider references in javadoc
    -parameters        generate method parameters attribute (for target &amp;gt;= 1.8)
    -genericsignature  generate generic signature for lambda expressions
    -Xemacs            used to enable emacs-style output in the console.
                       It does not affect the xml log output
    -missingNullDefault  report missing default nullness annotation

    -? -help           print this help message
    -v -version        print compiler version
    -showversion       print compiler version and continue

 Ignored options:
    -J&amp;lt;option&amp;gt;         pass option to virtual machine (ignored)
    -X&amp;lt;option&amp;gt;         specify non-standard option (ignored
                       except for listed -X options)
    -X                 print non-standard options and exit (ignored)
    -O                 optimize for execution time (ignored)
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Fri, 23 Mar 2018 04:59:19 -0400</pubDate><guid>https://answers.axonivy.com/questions/3146/can-we-configure-project-build-plugin-to-use-annotation-processor/3149</guid></item></channel></rss>