POM in Maven XML detailed introduction
POM represents the engineering object model. It is the basic build when working with Maven and is an XML file. It is placed in the project root directory and the file is named POM xml。
POM contains information about the project and various configuration details, which Maven uses to build the project.
POM also includes targets and plug-ins. When executing a task or target, Maven will find the POM in the current directory, read the required configuration information, and then execute the target. Some configurations that can be set in POM are as follows:
Project dependencies plugins goals build profiles project version developers mailing list before creating POM, we first determine the project group (groupid), its name (artifact ID) and version. These attributes are the unique identification of the project in the warehouse.
POM example
It should be noted that each project should have only one POM file.
All POM files need a project element and three required fields: groupid, artifactid and version. The project ID in the warehouse is groupid: artifactid: version POM The root element of XML is project, which has three main child nodes:
Super POM all POMS inherit from a parent POM (whether explicitly defined or not). The parent POM is also called super POM, which contains some default settings that can be inherited.
Maven uses effective POM (super POM plus the project's own configuration) to implement relevant goals. It helps developers make as few configurations as possible in pom.xml. Of course, these configurations can be easily rewritten.
A simple way to view the default configuration of super POM is to execute the following command: MVN help: effective POM
Create a POM in any directory on your computer XML file, using the content in the sample POM mentioned above.
In the following example, we create a POM. Net in the C: \ MVN \ project directory XML file.
Now open the command console and go to POM Execute the following MVN command in the directory where XML is located.
Maven will start processing and display effective POM.
The results of effective POM are just like those displayed on the console. After inheritance and interpolation, the configuration takes effect.
POM. On top XML, you can see the default project source code directory structure, output directory, required plug-ins, warehouse and report directory that Maven needs to use when executing the target.
Maven's POM XML files do not need to be written manually.
Maven provides a large number of prototype plug-ins to create projects, including engineering structure and POM xml。
summary
The above is about POM in Maven XML details all the contents, I hope to help you. Interested friends can continue to refer to this site: detailed introduction to Maven construction life cycle, detailed explanation of Maven management springboot profile, Maven learning - first glimpse of the path, etc. if you have any questions, you can leave a message at any time. You are welcome to leave valuable comments, and the editor will modify it in time. Thank you for your support!