Fixed issue 41547: Errors in build from UI are not shown
authorJavier Armendáriz <javier.armendariz@openbravo.com>
Mon, 05 Aug 2019 13:33:16 +0200
changeset 36266 59f670b19433
parent 36265 431ffa6714d0
child 36267 ab5174641bf5
Fixed issue 41547: Errors in build from UI are not shown

Log4j configuration is missing in BuildTask ant task. This causes
that when this task fails, the error message is not passed to
OBRebuildAppender and thus the process finishes as successful from
the point of view of the UI.
build.xml
src-core/src/org/openbravo/utils/OBRebuildAppender.java
--- a/build.xml	Mon Jul 22 13:10:02 2019 +0200
+++ b/build.xml	Mon Aug 05 13:33:16 2019 +0200
@@ -996,6 +996,7 @@
     <java classname="org.openbravo.base.BuildTask" jvm="${env.JAVA_HOME}/bin/java" fork="yes" maxmemory="${build.maxmemory}">
       <arg line="'${base.config}/Openbravo.properties' ${logFileName}" />
       <classpath>
+        <pathelement path="${base.config}" />
         <pathelement path="${build.core.lib}/openbravo-core.jar" />
         <pathelement path="${base.lib}/runtime/log4j-1.2-api-2.11.1.jar" />
         <pathelement path="${base.lib}/runtime/log4j-api-2.11.1.jar" />
--- a/src-core/src/org/openbravo/utils/OBRebuildAppender.java	Mon Jul 22 13:10:02 2019 +0200
+++ b/src-core/src/org/openbravo/utils/OBRebuildAppender.java	Mon Aug 05 13:33:16 2019 +0200
@@ -65,7 +65,7 @@
         return;
       }
 
-      String message = event.getMessage().toString();
+      String message = event.getMessage().getFormattedMessage();
       if (message.length() > 3000) {
         message = message.substring(0, 2997) + "...";
       }