as a ZIP of browse its content.
- a classpath entries list in target/gwt.classpath file (warning : files path are absolute)
The "ForkBooter" class is used to launch a JVM and build a classloader with all required classpath entries, without requirement for a long command line :
/**
* A (simplified) surefire-like bootstrapper to run some GWT component in a forked JVM without limitation of command
* line length to define the classpath.
*
* @author ndeloof
* @version $Id: ForkBooter.java 8738 2009-01-17 21:15:43Z olamy $
*/
public class ForkBooter
{
public static void main( String[] args )
throws Exception
{
String fileName = args[0];
String className = args[1];
ClassLoader cl = getClassLoader( fileName );
Class<?> gwt = cl.loadClass( className );
Thread.currentThread().setContextClassLoader( cl );
Method method = gwt.getMethod( "main", new Class[] { String[].class } );
String[] compilerArgs = new String[args.length - 1];
System.arraycopy( args, 1, compilerArgs, 0, args.length - 1 );
method.invoke( null, (Object) compilerArgs );
}
private static ClassLoader getClassLoader( String fileName )
throws FileNotFoundException, IOException, MalformedURLException
{
BufferedReader reader = new BufferedReader( new FileReader( fileName ) );
List<URL> classpath = new LinkedList<URL>();
String line;
while ( ( line = reader.readLine() ) != null )
{
classpath.add( new File( line ).toURI().toURL() );
}
URL[] urls = (URL[]) classpath.toArray( new URL[classpath.size()] );
return new URLClassLoader( urls, ClassLoader.getSystemClassLoader() );
}
}