- POM(Project Object Model):
pom.xml
:- Maven project structure and contents are declared in an
pom.xml
file. - Resides in the base directory of the project
- mandatory fields:
groupId
,artifactId
,version
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.companyname.project-group</groupId> <artifactId>project</artifactId> <version>1.0</version> </project>
- Maven project structure and contents are declared in an
- Projects notation in repository is groupId:artifactId:version
- Super POM: ALL POMs inherit from a parent
- effective pom: configuration from super pom plus project configuration
- check default configurations of super POM:
mvn help:effective-pom
A Build Lifecycle is a well defined sequence of phases.
A phase represents a stage in life cycle.
A goal represents a specific task.
Three standard lifecycles: clean, default/build, site
mvn clean dependency:copy-dependencies package
Executing order: phase clean
--> goal dependency:copy-dependencies
--> phase package
clean:clean
goal is bound to the clean phase in the clean lifecycle. It deletes build directory.