Core Modules

There are several core modules for creating jar libraries, EJBs, webapps and ear files:

lib.xmlFor creating standard java jar file projects.
ejb.xmlFor creating EJB modules.
webapp.xmlFor creating web applications.
ear.xmlFor packaging complex J2EE applications.

Your build file should only import one of these, depending upon the intended distribution type. Ideally core modules produce a single distribution file. You should break your project into modules along the lines of the core modules target types (jar, war, ejb, ear). Standard targets are defined near the top of the core module and serve as templates when overriding targets. The most common standard target names in core modules are: setup, gen, compile, dist, repo, clean.