details:   https://code.openbravo.com/erp/devel/pi/rev/091b2c16deaf
changeset: 20765:091b2c16deaf
user:      Shankar Balachandran <shankar.balachandran <at> openbravo.com>
date:      Thu Jul 18 18:46:02 2013 +0530
summary:   Fixes Issue 20623 : Modifications made to ant task

The ant task definition has been modified from java type to taskdef to enable 
execution without main method.

diffstat:

 build.xml                                                   |  5 +++--
 src/org/openbravo/erpCommon/utility/MigrateAttachments.java |  9 +++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 78ca177ad70d -r 091b2c16deaf build.xml
--- a/build.xml Thu Jul 18 09:31:04 2013 +0530
+++ b/build.xml Thu Jul 18 18:46:02 2013 +0530
@@ -372,9 +372,10 @@
   </target>
 
   <target name="migrate.attachments" depends="init">
-    <java classname="org.openbravo.erpCommon.utility.MigrateAttachments" 
fork="true" failonerror="yes" jvm="${env.JAVA_HOME}/bin/java">
+    <taskdef name="MigrateAttachments" 
classname="org.openbravo.erpCommon.utility.MigrateAttachments" >
       <classpath refid="project.class.path" />
-    </java>
+    </taskdef>
+    <MigrateAttachments/>
   </target>
 
   <target name="smartbuild" depends="init">
diff -r 78ca177ad70d -r 091b2c16deaf 
src/org/openbravo/erpCommon/utility/MigrateAttachments.java
--- a/src/org/openbravo/erpCommon/utility/MigrateAttachments.java       Thu Jul 
18 09:31:04 2013 +0530
+++ b/src/org/openbravo/erpCommon/utility/MigrateAttachments.java       Thu Jul 
18 18:46:02 2013 +0530
@@ -41,11 +41,16 @@
 
   private static Logger log = 
LoggerFactory.getLogger(MigrateAttachments.class);
 
-  public static void execute(String[] args) throws Exception {
+  @Override
+  public void execute() {
     String attachPath = 
OBPropertiesProvider.getInstance().getOpenbravoProperties()
         .getProperty("attach.path");
     log.info("Migrating Attachments");
-    migrateAttachments(attachPath);
+    try {
+      migrateAttachments(attachPath);
+    } catch (Exception e) {
+      log.error(e.getMessage(), e);
+    }
     log.info("Migration Successful");
   }
 

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to