[log4j2] Added a compiler flag to avoid an annotation processing warning.
authorJavier Armendáriz <javier.armendariz@openbravo.com>
Tue, 06 Nov 2018 13:49:58 +0100
changeset 35051 39ca8303034e
parent 35050 67c8675968d5
child 35052 6474c4dae278
[log4j2] Added a compiler flag to avoid an annotation processing warning.

Classes implicitly compiled, that is, that are compiled because a target class
requires it and it is not compiled yet, will not pass through the annotation
processor. This can be avoided by compiling the classes that requires log4j
annotation processor before all other classes during build, adding them directly
as javac target or defining explicitly the policy on compiling implicit classes,
which is -implicit:class by default, that means that a .class file will be created
by each dependency.
For more info see:
https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html#BHCJJJAJ
src/build.xml
--- a/src/build.xml	Tue Nov 06 12:14:46 2018 +0100
+++ b/src/build.xml	Tue Nov 06 13:49:58 2018 +0100
@@ -167,6 +167,7 @@
       <src path="../src-gen"/>
       <src path="../modules/org.openbravo.base.weld/src/"/>
       <classpath refid="apply.module.compile.classpath" />
+      <compilerarg value="-implicit:class" />
     </javac>
   </target>
   
@@ -226,7 +227,8 @@
       </javac>
       -->
       <javac srcdir="${base.src}:${base.src.gen}:${base.modules}" includes="org/openbravo/model/**,org/openbravo/base/structure/**,org/openbravo/dal/**,org/openbravo/service/dataset/**,*/src/**/base/weld/**" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on" includeantruntime="false">
-        <classpath refid="project.class.path" />      
+        <classpath refid="project.class.path" />
+        <compilerarg value="-implicit:class" />
       </javac>
       <javac srcdir="${base.src.gen}" excludes="org/openbravo/model/**,org/openbravo/base/structure/**,org/openbravo/dal/**,org/openbravo/service/dataset/**" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on" includeantruntime="false">
         <classpath refid="project.class.path" />
@@ -266,6 +268,7 @@
   <target name="compile.src.gen" depends="init">
     <javac srcdir="${basedir}" includes="org/openbravo/base/exception/**,org/openbravo/base/gen/**,org/openbravo/base/expression/**,org/openbravo/base/provider/**,org/openbravo/base/model/**,org/openbravo/base/session/**,org/openbravo/base/validation/**,org/openbravo/base/util/**" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on" includeantruntime="false">
       <classpath refid="project.class.path" />
+      <compilerarg value="-implicit:class" />
     </javac>
     <copy todir="${build}">
       <fileset dir="${basedir}">