You can see from this example Maven script contributed by Owen Jacobsen that, unlike ANT (A Neat Tool), you don’t get involved with the low level details of the various steps of compilation and bundling.
The <packaging> element, near the top, is enough to tell Maven how to build things, in most cases: <packaging>jar</packaging>, for example, causes src/main/java to be compiled, src/main/resources to be copied (and optionally filtered through a token-replacement layer), src/test/java to be compiled and run as test cases, then the resulting classes and files from src/main used to build a JAR. There are built-in packaging types for JARs, WAR (Web Archive) s, EAR (Enterprise Archive file) s, EJB-JARs, RAR (Roshal Archive)s and some maven infrastructure types like pom. New packaging types (with associated standard build procedures) can be implemented as plugins — there are, for example, plugins for JBoss SAR (Service Archive) files, Flex applications and libraries, and a bunch of other things.
If you need to specify how to build something, you can add new plugins to the build (not shown in the example) or reconfigure the standard plugins to behave differently. There’s also an inheritance model, where projects can inherit settings.
Most of the information in pom.xml is actually not related to building the project at all: it’s metadata about the project.
|
|
You can get the freshest copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) |
| http://mindprod.com/jgloss/maven.html | J:\mindprod\jgloss\maven.html | |
![]() | Please email your feedback for publication,
letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording,
broken/redirected link reports, suggestions to improve this page or comments to
Roedy Green :
| |
| Canadian Mind Products | ||
| mindprod.com IP:[65.110.21.43] | ||
| view Blog | Your face IP:[38.107.179.210] | |
| Feedback | You are visitor number 8,206. | |