Now you need to use Ant to execute a class file with the main method, and you need to pass two parameters (start and end) to the main method through a command.
1 <Targetname= "GSP"depends= "Compile"Description= "Generator structure Pictures">2 <Echomessage= "-----------Generator structure pictures------------" />3 < Propertyname= "Start"value= "1" />4 < Propertyname= "End"value= "892046" />5 <JavaFork= "true"ClassName= "Com.founder.cst.system.StructureImageGenerator">6 <Argvalue= "${start}"/>7 <Argvalue= "${end}"/>8 <ClasspathPath= "${build.dir}/classes"/>9 <ClasspathrefID= "Classpath" />Ten </Java> One <Echomessage= "-----------End------------" /> A </Target>
This allows the ant gsp-dstart=10-dend=20 to upload 10 and 20 to the main method, preferably setting the default value.
Original link: http://blog.csdn.net/huang_xw/article/details/8026428
Ant executes a class file that contains the Main method