Home > Articles > Programming > Java

  • Print
  • + Share This
Like this article? We recommend

Use Consistent Naming

Most developers know that consistency is a good thing. Even more so with Ant—it is important for the names of common Ant targets. Keeping the target names the same across projects avoids having to constantly review the build file to determine what the target names are (and more importantly, what each target does).

If your build file always has the following targets, then the most common functions of the build file can be used without review:

  • clean
  • compile
  • jar
  • war
  • ear
  • test
  • help

Naturally, not all these targets apply to all projects, and there certainly will be additional targets beyond them. That is where the help target comes into play, by creating a help target that prints out all the targets and their purposes, making your build file that much easier to use.

  • + Share This
  • 🔖 Save To Your Account