details: https://code.openbravo.com/erp/devel/pi/rev/bc617f478775 changeset: 35120:bc617f478775 user: Javier Armendáriz <javier.armendariz <at> openbravo.com> date: Fri Nov 23 10:32:52 2018 +0100 summary: Fixed issue 39663: Build fails in Java 11 since log4j upgrade.
New log4j libraries are multi-release jars (mrjar), meaning that they can define multiple version of classes depending on the JVM version being run. Currently ant does not support mrjars for custom java tasks and build fails when executing LogManager.getLogger() inside an ant task. For this reason, a new jar is included during build to override LogManager and StackLocator implementation to make build work in Java9+. In addition, classpath in build script is modified to force including the build libraries first in the classpath and use these classes instead of the ones implemented in log4j-api. diffstat: build.xml | 4 ++++ lib/build/log4j-api-no-mrjar-2.11.1.jar | Bin src-db/database/build-create.xml | 4 ++++ src-db/database/build.xml | 4 ++++ src-util/diagnostic/build-create.xml | 4 ++++ 5 files changed, 16 insertions(+), 0 deletions(-) diffs (62 lines): diff -r 641c5b66d580 -r bc617f478775 build.xml --- a/build.xml Fri Nov 23 11:45:53 2018 +0100 +++ b/build.xml Fri Nov 23 10:32:52 2018 +0100 @@ -245,7 +245,11 @@ <pathelement path="${base.config}" /> <pathelement path="${build}" /> <pathelement path="${base.src}" /> + <fileset dir="${base.lib}/build"> + <include name="*.jar" /> + </fileset> <fileset dir="${base.lib}"> + <exclude name="build/*" /> <include name="**/*.jar" /> </fileset> <fileset dir="${build.core.lib}"> diff -r 641c5b66d580 -r bc617f478775 lib/build/log4j-api-no-mrjar-2.11.1.jar Binary file lib/build/log4j-api-no-mrjar-2.11.1.jar has changed diff -r 641c5b66d580 -r bc617f478775 src-db/database/build-create.xml --- a/src-db/database/build-create.xml Fri Nov 23 11:45:53 2018 +0100 +++ b/src-db/database/build-create.xml Fri Nov 23 10:32:52 2018 +0100 @@ -35,7 +35,11 @@ <include name="**/*.jar" /> </fileset> <pathelement path="${build}" /> + <fileset dir="${base.lib}/build"> + <include name="*.jar" /> + </fileset> <fileset dir="${base.lib}"> + <exclude name="build/*" /> <include name="**/*.jar" /> </fileset> <pathelement path="${base.config}" /> diff -r 641c5b66d580 -r bc617f478775 src-db/database/build.xml --- a/src-db/database/build.xml Fri Nov 23 11:45:53 2018 +0100 +++ b/src-db/database/build.xml Fri Nov 23 10:32:52 2018 +0100 @@ -46,7 +46,11 @@ <exclude name="**/dbsourcemanagerlight.jar" /> </fileset> <pathelement path="${build}" /> + <fileset dir="${base.lib}/build"> + <include name="*.jar" /> + </fileset> <fileset dir="${base.lib}"> + <exclude name="build/*" /> <include name="**/*.jar" /> </fileset> <pathelement path="${base.config}" /> diff -r 641c5b66d580 -r bc617f478775 src-util/diagnostic/build-create.xml --- a/src-util/diagnostic/build-create.xml Fri Nov 23 11:45:53 2018 +0100 +++ b/src-util/diagnostic/build-create.xml Fri Nov 23 10:32:52 2018 +0100 @@ -20,7 +20,11 @@ <project name="openbravo-diagnostics-build" basedir="." default="build"> <path id="diagnostic.class.path"> + <fileset dir="../../lib/build"> + <include name="*.jar" /> + </fileset> <fileset dir="../../lib/"> + <exclude name="build/*" /> <include name="**/*.jar" /> </fileset> </path> _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits