You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by xa...@apache.org on 2007/05/15 14:27:40 UTC

svn commit: r538187 - /incubator/ivy/core/trunk/src/java/org/apache/ivy/Main.java

Author: xavier
Date: Tue May 15 07:27:39 2007
New Revision: 538187

URL: http://svn.apache.org/viewvc?view=rev&rev=538187
Log:
set context classloader when invking main method, so that code using the context classloader can view classes loaded by the classloader setup by Ivy

Modified:
    incubator/ivy/core/trunk/src/java/org/apache/ivy/Main.java

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/Main.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/Main.java?view=diff&rev=538187&r1=538186&r2=538187
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/Main.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/Main.java Tue May 15 07:27:39 2007
@@ -435,7 +435,7 @@
         	
         	Method mainMethod = c.getMethod("main", new Class[] { String[].class });
         	
-        	// Split up arguments 
+        	Thread.currentThread().setContextClassLoader(classLoader);
         	mainMethod.invoke(null, new Object[] { (args == null ? new String[0] : args) });
         } catch (ClassNotFoundException cnfe) {
         	throw new RuntimeException("Could not find class: " + mainclass, cnfe);