{"id":1201,"date":"2016-08-29T14:50:58","date_gmt":"2016-08-29T14:50:58","guid":{"rendered":"http:\/\/www.testingdocs.com\/questions\/?p=1201"},"modified":"2021-03-21T09:32:33","modified_gmt":"2021-03-21T09:32:33","slug":"what-is-maven-pom-file","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/what-is-maven-pom-file\/","title":{"rendered":"What is Maven POM file?"},"content":{"rendered":"<h3>Overview<\/h3>\n<p>POM stands for Project Object Model. Maven POM file is an XML file. You can locate the file under the project root or base directory of the Maven project. It contains crucial information about the project and project configuration that are used by Maven to build the project.<\/p>\n<h3>Structure<\/h3>\n<p>Every POM file has the following:<br \/>\nproject<br \/>\nmodelVersion<br \/>\ngroupID<br \/>\nartifactID<br \/>\nVersion<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1083\" src=\"http:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/POM.xml-Maven.png\" alt=\"POM.xml Maven\" width=\"1356\" height=\"656\" title=\"\"><\/p>\n<h3><strong>Sample pom.xml<\/strong><\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/maven-v4_0_0.xsd\"&gt;\r\n &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n &lt;groupId&gt;com.testingdocs.demo.webapp&lt;\/groupId&gt;\r\n &lt;artifactId&gt;simple-webapp&lt;\/artifactId&gt;\r\n &lt;packaging&gt;war&lt;\/packaging&gt;\r\n &lt;version&gt;1.0-SNAPSHOT&lt;\/version&gt;\r\n &lt;name&gt;simple-webapp Maven Webapp&lt;\/name&gt;\r\n &lt;url&gt;http:\/\/www.testingdocs.com&lt;\/url&gt;\r\n &lt;dependencies&gt;\r\n &lt;dependency&gt;\r\n &lt;groupId&gt;junit&lt;\/groupId&gt;\r\n &lt;artifactId&gt;junit&lt;\/artifactId&gt;\r\n &lt;version&gt;4.12&lt;\/version&gt;\r\n &lt;scope&gt;test&lt;\/scope&gt;\r\n &lt;\/dependency&gt;\r\n &lt;\/dependencies&gt;\r\n &lt;build&gt;\r\n &lt;finalName&gt;simple-webapp&lt;\/finalName&gt;\r\n &lt;\/build&gt;\r\n&lt;\/project&gt;<\/pre>\n<p>&nbsp;<\/p>\n<h3><strong>Super POM<\/strong><\/h3>\n<p>Super POM is the default parent POM. All the maven project pom files extend from Super POM. Maven uses the configuration from the Super POM to execute the goals. In case you want to override the parent configuration, you can do so in your project pom.xml. To check the default parent POM configuration with the use of effective POM.<\/p>\n<p>Below are the steps to open Effective POM in different IDE&#8217;s<\/p>\n<h3><strong>Eclipse IDE:<\/strong><\/h3>\n<p>Open pom.xml in Maven Editor, click on Effective POM tab as shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1081\" src=\"http:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Eclipse-Effective-POM.png\" alt=\"Eclipse Effective POM\" width=\"1365\" height=\"642\" title=\"\"><\/p>\n<h3><strong>IntelliJ IDEA<\/strong><\/h3>\n<p>Right click <strong>pom.xml &gt;&gt; Maven &gt;&gt; Show Effective POM<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1082\" src=\"http:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Effective-POM-IntelliJ.png\" alt=\"Effective POM IntelliJ\" width=\"1119\" height=\"743\" title=\"\"><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>Command line<\/strong><\/h3>\n<p>Browse to the project root directory in command console. Execute the below maven command as shown below:<\/p>\n<p><strong>\/&gt; mvn help:effective-pom<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1084\" src=\"http:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Command-Line-Effective-POM.png\" alt=\"Command Line Effective POM\" width=\"1345\" height=\"647\" title=\"\"><\/p>\n<!--themify_builder_content-->\n<div id=\"themify_builder_content-1201\" data-postid=\"1201\" class=\"themify_builder_content themify_builder_content-1201 themify_builder tf_clear\">\n    <\/div>\n<!--\/themify_builder_content-->\n","protected":false},"excerpt":{"rendered":"<p>Overview POM stands for Project Object Model. Maven POM file is an XML file. You can locate the file under the project root or base directory of the Maven project. It contains crucial information about the project and project configuration that are used by Maven to build the project. Structure Every POM file has the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1201","post","type-post","status-publish","format-standard","hentry","category-automation","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/1201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=1201"}],"version-history":[{"count":3,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/1201\/revisions"}],"predecessor-version":[{"id":19826,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/1201\/revisions\/19826"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=1201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=1201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=1201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}