POM refers to Project Object Model. It is an XML file which contains the information about the project and various configuration detail used by Maven to build the project like build directory, source directory, dependencies, test source directory, plugin, goals etc.
Element | Description |
project | This is the root element of pom.xml file. |
modelVersion | This is the sub element of project which specifies the modelVersion. Model version should be 4.0.0. |
groupId | This is the sub element of project which specifies the id for the project group. |
artifactId | This is the sub element of project which specifies the id for the project. This is generally refers to the name of the project. The artifact ID is also used as part of the name of the JAR, WAR or EAR file produced when building the project. |
version | This is the sub element of project which specifies the version of the project. |
packaging | It is used to define the packaging type such as jar, war etc. |
name | It is used to define the name of the maven project. |
url | It is used to define the url of the project. |
dependencies | It is used to define the dependencies for this project. |
dependency | It is used to define a dependency. It is used inside dependencies element. |
scope | It is used to define the scope for this maven project. It can be compile, provided, runtime, test and system. |
Related topics
- What are the build tools in java?
- What are the aspects Maven manages?
- how to check the maven version in windows?
- how to check the maven version in linux?
- how to check the maven version in mac?
- What information does pom contain?
- What is a goal in maven?
- What are the types of repository in maven?
- Explain Maven repository search order
- What is local repository in maven?
- What is central repository in maven?
- What is remote repository in maven?
- What is maven plugin used for?
- What are the types of maven plugins?
- What is archetype in maven?
- How profiles are specified in maven?
- How can you build your project offline?
- How to exclude dependency in maven?