All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org_scala_tools_maven_executions.MainWithArgsInFile Maven / Gradle / Ivy

Go to download

The maven-scala-plugin is used for compiling/testing/running/documenting scala code in maven.

The newest version!
package org_scala_tools_maven_executions;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * Use a file and reflection to start a main class with arguments define in a file.
 * This class should run without other dependencies than jre.
 * This class is used as a workaround to the windows command line size limitation.
 *  
 * @author David Bernard
 */
public class MainWithArgsInFile {

    /**
     * @param args
     */
    public static void main(String[] args) {
        try {
            String mainClassName = args[0];
            List argsFromFile = new ArrayList();
            if (args.length > 0) {
                argsFromFile = MainHelper.readArgFile(new File(args[1]));
            }
            MainHelper.runMain(mainClassName, argsFromFile, null);
        } catch(Throwable t) {
            t.printStackTrace();
            System.exit(-10000 /*Integer.MIN_VALUE*/);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy