use ant in eclipse

      I have been writing java web before, and it is very convenient to use myeclipse to develop, debug and package. Although I know a little about ant and maven, I have not practiced it in the project and have not done much understanding. Now I want to write a local program in java and generate some reports regularly, so I feel that eclipse is not very easy to use, so I simply practice ant and use ant for debugging and packaging.

      The purpose of this project is to generate some reports regularly at 0:00:00 on the 1st of the next month. So you need to write a java local program to link oracle to generate reports, use windows scheduling management, or use cron under linux to regularly call java report generator. Therefore, there are three aspects of work that need to be done, 1. The writing of java report generator, 2. the writing of bat under windows, and the writing of shell batch processing under linux, batch processing is to execute java classes under this operating system, 3. Configuration cron makes timed calls.

     1. To use ant in eclipse, first create a java project and create a build.xml file in the project root directory.

      2. Use the ant build file as the project builder.

            Right-click the project, select properties, select builders, click the new button, select ant builder, create a new ant builder, and remove the checkmark for java builder.



 

       3. At this point, the ant project can be built in eclipse. To set up a power-off debug project in eclipse, some operations are required. Click the down arrow on the right of debug -> debug configuration, select the classpath tab, click add external jars... to add all the jar packages under ant_home. If you do not configure ant manually, you can select window->properties->ant->runtime->class path to view the specific location.

       4. Click main in the debug configuration window and fill in org.apache.tools.ant.Main in the main class. At this point, you should be able to debug the program by setting breakpoints in the class.

      During the configuration process, there was an error of unable to install breakpoint in ........ due to missing line number attributes, because the option of debug = true was not added to the compile task.


 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326358951&siteId=291194637