This article covers basic concepts of maven self. Lastly i described how to setup maven.
Maven is a project management framework (or tool).
Maven provides a comprehensive model that can be applied to all software projects. That model uses a common project “language”, and the software tool is just a supporting element within this model.
For a long time i was an Apache Ant user it's important for me to emphasize some key differences in maven philosophy.
It's possible to build any given project without having to understand how the individual plug-ins works.
Maven provides declarative style. Instead of defining procedures your configure it.
These three elements defines the ID of an artifact and in effect of the particular build results.
The POM-Tree gives a quick overview, what it is all bout. Of course you don't have to be familiar with all that parts of the tree. It is usual to start working with simple pom and extending it step by step if default behavior is not sufficient. Therefore pom.xml represents static project configuration, let's look how this configuration apply on build-time.
will execute all phases except deploy and do on. It is also possible to call phases of different lifecycles e.g.
this command will traverse into all of the lifecycles and run clean including all of the prior steps then install in the same way.
A Goal represents a specific task (finer than a build phase) which actually caries out the amount of work.
dependency:copy-dependencies is an unbound goal, which is executed as it is. clean and package are phases and executed like phases with predecessors.
Moreover, if a goal is bound to one or more build phases, that goal will be called in all those phases.
Therefore it's getting essential to know how that Built-in Lifecycle bindings between phases and goals looks like. And then to know how are binding to the default plugins. In the Lifecycle List above you can see all the default bounded goals. Effectively these goals are executed every time in default configuration.
Profiles are specify some subset of POM definition. Piratically profiles modify the POM at build time, and are meant to be used to give context dependent parameters. Fro example they allow to define test and production context without creating several different POM definitions. Profile-definitions is defined inside of pom.xml or settings.xml following same inheritance rules as the rest of POM file (read above).
But in case of pom definition it is considerable to use use "smart activation" of a profile. Example below show's example profile definition which will be activated automatically on apple mac computers. The defined Profiled with id default_mac only set property: build.style="Macintosh"
I hope this helps someone to go quick and dirty familiar with maven. For details pleas ask questions or see following resources.