简体   繁体   English

如何在不同的Java IDE中更新一组ant构建脚本?

[英]How to keep a set of ant build scripts updated in different java IDEs?

My team members are developing different java projects using InteliJ, Eclipse and NetBeans. 我的团队成员正在使用InteliJ,Eclipse和NetBeans开发不同的Java项目。 As a software configuration management practice, I need to have a standard Ant build script for each of these projects. 作为软件配置管理实践,我需要为每个项目都有一个标准的Ant构建脚本。 Unfortunately, the ant scripts generated by these IDEs are not in a standard format and may contain many IDE-specific tasks. 遗憾的是,这些IDE生成的ant脚本不是标准格式,可能包含许多特定于IDE的任务。 Furthermore, some IDEs, eg InteliJ, do not update the generated Ant files automatically when the project is changed, therefore an automatic build may simply be broken. 此外,某些IDE(例如InteliJ)在项目更改时不会自动更新生成的Ant文件,因此可能会简单地破坏自动构建。 Now, here is the problem: I have a set of build scripts. 现在,问题出在这里:我有一组构建脚本。 I need: 我需要:

  1. The scripts to be in a standard format 脚本采用标准格式
  2. The build scripts to be updated automatically by the used IDEs (InteliJ, Eclipse,NetBeans) when the project is updated. 在项目更新时,使用的IDE(InteliJ,Eclipse,NetBeans)自动更新构建脚本。

Is there any straightforward method to do this job? 有没有直接的方法来完成这项工作?

Do not use IDEs to generate ant scripts. 不要使用IDE生成ant脚本。 You need solid repeatable builds working without IDEs (for example on CI server like Hudson/Jenkins). 您需要在没有IDE的情况下运行可靠的可重复构建(例如在像Hudson / Jenkins这样的CI服务器上)。 Best way to have standard build is to use maven, and generate IDE projects from pom. 标准构建的最佳方法是使用maven,并从pom生成IDE项目。 ( IDEA works with maven natively - no need to generate project files ) (IDEA原生使用maven - 无需生成项目文件)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM