挂钩到 Eclipse 构建过程?

2022-01-16 00:00:00 eclipse-plugin java eclipse

我希望能够在 Eclipse 中按下构建按钮时运行一个简单的 Java 程序.目前,当我单击构建时,它会运行一些 JRebel 日志记录代码.我有一个程序可以解析 JRebel 日志文件并将统计信息存储在数据库中.

I'd like to be able to run a simple Java program when the build button is pressed in Eclipse. Currently when I click build, it runs some JRebel logging code. I have a program that parses the JRebel log file and stores statistics in a DB.

是否可以编写一个插件或以某种方式挂钩到 Eclipse 的构建过程中,以便在 JRebel 日志记录完成后,它会运行我的程序来自动解析文件?

Is it possible to write a plugin or somehow hook into the build process of Eclipse, so that after the JRebel logging is done, it will run my program to parse the file automatically?

任何帮助都将不胜感激,即使您能指出我正确的方向.

Any help would be appreciated, even if you could just point me in the right direction.

提前致谢.

推荐答案

您可以将自定义 Builder 添加到您的 java 项目中.

You can add a custom Builder to your java project.

右键单击您的项目.选择属性.

Right-click on your project. Select Properties.

在左侧的树中选择Builders".

In the tree on the left side choose 'Builders'.

您可以添加 ant 脚本或特定程序.您还可以选择何时运行此工具(在 Java Builder 之前或之后).

You can either add an ant script or specific program. You also have ability to choose when this tool will be running ( before or after Java Builder ).

相关文章