Maven POM
The POM (Project Object Model) is the fundamental unit of work in Maven. It is an XML file that contains basic project information, describing how the project is built, declaring project dependencies, and more.
When executing tasks or goals, Maven looks for the POM in the current directory. It reads the POM, retrieves the necessary configuration information, and then executes the goals.
The POM can specify the following configurations:
- Project dependencies
- Plugins
- Execution goals
- Project build profiles
- Project version
- List of project developers
- Information about related mailing lists
Before creating a POM, we first need to describe the project group (groupId), which is the unique ID of the project.
<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">
<!-- Model version -->
<modelVersion>4.0.0</modelVersion>
<!-- Unique identifier of the company or organization, and the path generated during configuration is also based on this. For example, com.companyname.project-group, Maven will place the jar package of this project in the local path: /com/companyname/project-group -->
<groupId>com.companyname.project-group</groupId>
<!-- Unique ID of the project, used to distinguish multiple projects under the same groupId -->
<artifactId>project</artifactId>
<!-- Version number -->
<version>1.0</version>
</project>
All POM files require the project element and three mandatory fields: groupId, artifactId, and version.
Node | Description |
---|---|
project | The root tag of the project. |
modelVersion | The model version needs to be set to 4.0. |
groupId | This is the identifier of the project group. It is usually unique within an organization or project. For example, a banking organization com.companyname.project-group owns all banking-related projects. |
artifactId | This is the identifier of the project. It is usually the name of the project. For example, consumer banking. The groupId and artifactId together define the location of the artifact in the repository. |
version | This is the version number of the project. It is used in the artifact repository to distinguish different versions. For example: com.company.bank:consumer-banking:1.0, com.company.bank:consumer-banking:1.1 |
Parent (Super) POM
The Parent (Super) POM is Maven's default POM. All POMs inherit from a parent POM (whether explicitly defined or not). The parent POM contains default settings that can be inherited. Therefore, when Maven needs to download dependencies in the POM, it will go to the default repository http://repo1.maven.org/maven2 configured in the Super POM to download them.
Maven uses the effective POM (Super POM plus the project's own configuration) to execute related goals. It helps developers to minimize the configuration in pom.xml, although these configurations can be overridden.
Use the following command to view the Super POM default configuration:
mvn help:effective-pom
Next, we create the directory MVN/project, and within this directory, create a pom.xml with the following content:
<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">
<!-- Model version -->
<modelVersion>4.0.0</modelVersion>
<!-- Unique identifier for the company or organization, and the generated path for configuration is also derived from this, such as com.companyname.project-group. Maven will place the jar file generated from this project in the local path: /com/companyname/project-group -->
<groupId>com.companyname.project-group</groupId>
<!-- Unique ID for the project, within a groupId there may be multiple projects, which are distinguished by artifactId -->
<artifactId>project</artifactId>
<!-- Version number -->
<version>1.0</version>
</project>
In the command console, navigate to the MVN/project directory and execute the following command:
C:\MVN\project>mvn help:effective-pom
Maven will start processing and display the effective-pom.
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:36 min
[INFO] Finished at: 2018-09-05T11:31:28+08:00
[INFO] Final Memory: 15M/149M
[INFO] ------------------------------------------------------------------------
The result of the Effective POM is displayed as in the console, after inheritance and interpolation, making the configuration effective.
<?xml version="1.0" encoding="UTF-8"?>
<!-- ================================================================= -->
<!-- -->
<!-- Generated by Maven Help Plugin on 2012-07-05T11:41:51 -->
<!-- See: http://maven.apache.org/plugins/maven-help-plugin/ -->
<!-- -->
<!-- ================================================================= -->
<!-- ================================================================= -->
<!-- -->
<!-- Effective POM for project -->
<!-- 'com.companyname.project-group:project-name:jar:1.0' -->
<!-- -->
<!-- ================================================================= -->
<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>
<build>
<sourceDirectory>C:\MVN\project\src\main\java</sourceDirectory>
<scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
<testSourceDirectory>C:\MVN\project\src\test\java</testSourceDirectory>
<outputDirectory>C:\MVN\project\target\classes</outputDirectory>
<testOutputDirectory>C:\MVN\project\target\test-classes</testOutputDirectory>
<resources>
<resource>
<mergeId>resource-0</mergeId>
<directory>C:\MVN\project\src\main\resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<mergeId>resource-1</mergeId>
<directory>C:\MVN\project\src\test\resources</directory>
</testResource>
</testResources>
<directory>C:\MVN\project\target</directory>
<finalName>project-1.0</finalName>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2</version>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.3.1</version> </plugin> <plugin> <artifactId>maven-ejb-plugin</artifactId> <version>2.1</version> </plugin> <plugin> <artifactId>maven-install-plugin</artifactId> <version>2.2</version> </plugin> <plugin> <artifactId>maven-jar-plugin</artifactId> <version>2.2</version> </plugin> <plugin> <artifactId>maven-javadoc-plugin</artifactId> <version>2.5</version> </plugin> <plugin> <artifactId>maven-plugin-plugin</artifactId> <version>2.4.3</version> </plugin> <plugin> <artifactId>maven-rar-plugin</artifactId> <version>2.2</version> </plugin> <plugin> <artifactId>maven-release-plugin</artifactId> <version>2.0-beta-8</version> </plugin> <plugin> <artifactId>maven-resources-plugin</artifactId> <version>2.3</version> </plugin> <plugin> <artifactId>maven-site-plugin</artifactId> <version>2.0-beta-7</version> </plugin> <plugin> <artifactId>maven-source-plugin</artifactId> <version>2.0.4</version> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.4.3</version> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.1-alpha-2</version> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <artifactId>maven-help-plugin</artifactId> <version>2.1.1</version> </plugin> </plugins> </build> <repositories> <repository> <snapshots> <enabled>false</enabled> </snapshots> <id>central</id> <name>Maven Repository Switchboard</name> <url>http://repo1.maven.org/maven2</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Maven Plugin Repository</name>
<url>http://repo1.maven.org/maven2</url>
</pluginRepository>
</pluginRepositories>
<reporting>
<outputDirectory>C:\MVN\project\target/site</outputDirectory>
</reporting>
</project>
In the above pom.xml, you can see the default project source directory structure, output directory, required plugins, repositories, and reporting directories that Maven needs to use when executing goals.
The pom.xml file for Maven does not need to be written by hand.
Maven provides a large number of archetype plugins to create projects, including project structure and pom.xml.
Detailed Explanation of POM Tags
<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.0http://maven.apache.org/maven-v4_0_0.xsd">
<!--Coordinates of the parent project. If a value for an element is not specified in the project, the corresponding value from the parent project is used as the default. Coordinates include group ID, artifact ID, and version. -->
<parent>
<!--Artifact identifier of the inherited parent project -->
<artifactId />
<!--Globally unique identifier of the inherited parent project -->
<groupId />
<!--Version of the inherited parent project -->
<version />
<!--Relative path of the parent project's pom.xml file. The relative path allows you to choose a different path. The default value is ../pom.xml. Maven first looks for the parent project's pom in the location where the current project is built, then in the file system at this location (relativePath location), then in the local repository, and finally in the remote repository. -->
<relativePath />
</parent>
<!--Declares which POM model version the project descriptor follows. The model version itself rarely changes, but it is essential to ensure stability when Maven introduces new features or other model changes. -->
<modelVersion>4.0.0</modelVersion>
<!--Globally unique identifier of the project, typically using the fully qualified package name to distinguish it from other projects. The relative path generated during the build is also derived from this, e.g., com.mycompany.app generates a relative path of /com/mycompany/app -->
<groupId>asia.banseon</groupId>
<!--Identifier of the artifact, which together with the group ID uniquely identifies an artifact. In other words, you cannot have two different projects with the same artifact ID and group ID; within a specific group ID, the artifact ID must also be unique. Artifacts are things that a project produces or uses, and Maven produces artifacts such as JARs, source code, binary distributions, and WARs. -->
<artifactId>banseon-maven2</artifactId>
<!--Type of artifact the project produces, such as jar, war, ear, pom. Plugins can create their own artifact types, so the list is not exhaustive -->
<packaging>jar</packaging>
<!--Current version of the project, formatted as: major version.minor version.incremental version-qualifier version -->
<version>1.0-SNAPSHOT</version>
<!--Name of the project, used by Maven for documentation -->
<name>banseon-maven</name>
<!--URL of the project's home page, used by Maven for documentation -->
<url>http://www.baidu.com/banseon</url> <!-- Detailed description of the project, used by Maven for documentation. When this element can be described in HTML format (e.g., text within CDATA is ignored by parsers and can include HTML tags), using plain text descriptions is discouraged. If you need to modify the index page of the generated web site, you should modify your own index page file instead of adjusting the documentation here. --> <description>A Maven project to study Maven.</description> <!-- Describes the prerequisites in the project's build environment. --> <prerequisites> <!-- The minimum version of Maven required to build this project or use this plugin. --> <maven /> </prerequisites> <!-- The name and URL of the project's issue management system (Bugzilla, Jira, Scarab, or any issue management system you prefer), in this case, Jira. --> <issueManagement> <!-- The name of the issue management system (e.g., Jira). --> <system>jira</system> <!-- The URL of the issue management system used by the project. --> <url>http://jira.baidu.com/banseon</url> </issueManagement> <!-- Project continuous integration information. --> <ciManagement> <!-- The name of the continuous integration system, such as Continuum. --> <system /> <!-- The URL of the continuous integration system used by the project (if the CI system has a web interface). --> <url /> <!-- Configuration items for developers/users to be notified upon build completion, including notification recipients and conditions (error, failure, success, warning). --> <notifiers> <!-- Configuration for a method to notify users/developers when the build is interrupted. --> <notifier> <!-- The means of delivering the notification. --> <type /> <!-- Whether to notify on errors. --> <sendOnError /> <!-- Whether to notify on build failures. --> <sendOnFailure /> <!-- Whether to notify on build successes. --> <sendOnSuccess /> <!-- Whether to notify on warnings. --> <sendOnWarning /> <!-- Deprecated. Where to send the notification. --> <address /> <!-- Extended configuration options. --> <configuration /> </notifier> </notifiers> </ciManagement> <!-- The year the project was created, a 4-digit number. This value is needed when generating copyright information. --> <inceptionYear /> <!-- Project-related mailing list information. --> <mailingLists> <!-- This element describes all mailing lists related to the project. Automatically generated websites reference this information. --> <mailingList> <!-- The name of the mailing list. --> <name>Demo</name> <!-- The address or link to send emails. If an email address is provided, a mailto: link will be automatically created when generating documentation. --> <post>[email protected]</post> <!-- The address or link to subscribe to the mailing list. If an email address is provided, a mailto: link will be automatically created when generating documentation. --> <subscribe>[email protected]</subscribe> <!-- The address or link to unsubscribe from the mailing list. If an email address is provided, a mailto: link will be automatically created when generating documentation. --> <unsubscribe>[email protected]</unsubscribe> <!-- You can browse the email information URL --> <archive>http://hi.baidu.com/banseon/demo/dev/</archive> </mailingList> </mailingLists> <!-- Project developer list --> <developers> <!-- Information about a project developer --> <developer> <!-- Unique identifier of the project developer in the SCM --> <id>HELLO WORLD</id> <!-- Full name of the project developer --> <name>banseon</name> <!-- Email of the project developer --> <email>[email protected]</email> <!-- URL of the project developer's homepage --> <url /> <!-- Roles of the project developer in the project, role element describes various roles --> <roles> <role>Project Manager</role> <role>Architect</role> </roles> <!-- Organization the project developer belongs to --> <organization>demo</organization> <!-- URL of the organization the project developer belongs to --> <organizationUrl>http://hi.baidu.com/banseon</organizationUrl> <!-- Properties of the project developer, such as how to handle instant messaging, etc. --> <properties> <dept>No</dept> </properties> <!-- Time zone the project developer is in, an integer ranging from -11 to 12 --> <timezone>-5</timezone> </developer> </developers> <!-- List of other contributors to the project --> <contributors> <!-- Other contributors to the project. See developers/developer element --> <contributor> <name /> <email /> <url /> <organization /> <organizationUrl /> <roles /> <timezone /> <properties /> </contributor> </contributors> <!-- This element describes the list of all licenses for the project. Only list the project's licenses, not the licenses of dependencies. If multiple licenses are listed, users can choose one instead of accepting all. --> <licenses> <!-- Describes the project's license, used to generate the license page of the project's website, and some reports and validations also use this element. --> <license> <!-- Legal name of the license --> <name>Apache 2</name> <!-- Official URL of the license text page --> <url>http://www.baidu.com/banseon/LICENSE-2.0.txt</url> <!-- Main distribution method of the project: repo, can be downloaded from the Maven repository; manual, users must manually download and install dependencies --> <distribution>repo</distribution> <!-- Additional information about the license --> <comments>A business-friendly OSS license</comments> </license> </licenses> <!--SCM (Source Control Management) tag allows you to configure your code repository for use by the Maven web site and other plugins. --> <scm> <!--SCM URL, this URL describes the repository and how to connect to it. For more details, see the URL formats and list provided by SCMs. This connection is read-only. --> <connection> scm:svn:http://svn.baidu.com/banseon/maven/banseon/banseon-maven2-trunk(dao-trunk) </connection> <!--For developers to use, similar to the connection element. This connection is not read-only. --> <developerConnection> scm:svn:http://svn.baidu.com/banseon/maven/banseon/dao-trunk </developerConnection> <!--The tag of the current code, defaults to HEAD during development. --> <tag /> <!--URL pointing to a browsable SCM repository (such as ViewVC or Fisheye). --> <url>http://svn.baidu.com/banseon</url> </scm> <!--Describes various properties of the project's organization. Used by Maven to generate documentation. --> <organization> <!--Full name of the organization. --> <name>demo</name> <!--URL of the organization's main page. --> <url>http://www.baidu.com/banseon</url> </organization> <!--Information required to build the project. --> <build> <!--This element sets the project source code directory, where the build system will compile the source code. The path is relative to the pom.xml. --> <sourceDirectory /> <!--This element sets the project script source code directory, which is different from the source code directory: in most cases, the contents of this directory will be copied to the output directory (because scripts are interpreted, not compiled). --> <scriptSourceDirectory /> <!--This element sets the source code directory used for unit tests, where the build system will compile the source code when testing the project. The path is relative to the pom.xml. --> <testSourceDirectory /> <!--Directory where the compiled application class files are stored. --> <outputDirectory /> <!--Directory where the compiled test class files are stored. --> <testOutputDirectory /> <!--Uses a series of build extensions from this project. --> <extensions> <!--Describes the build extensions used. --> <extension> <!--groupId of the build extension. --> <groupId /> <!--artifactId of the build extension. --> <artifactId /> <!--Version of the build extension. --> <version /> </extension> </extensions> <!--Default value when no target (Maven2 called phase) is specified for the project. --> <defaultGoal /> <!--This element describes a list of all resource paths related to the project, such as property files, which are included in the final packaged file. --> <resources> <!--This element describes all resource paths related to or used in testing the project. --> <resource> <targetPath /> <!-- Describes the target path of the resource. This path is relative to the target/classes directory (e.g., ${project.build.outputDirectory}). For example, if you want the resource in a specific package (org.apache.maven.messages), you must set this element to org/apache/maven/messages. However, if you just want to place the resource in the source directory structure, this configuration is not needed. --> <filtering /> <!-- Whether to use parameter values instead of parameter names. Parameter values are taken from properties elements or properties configured in files listed in the filters element. --> <directory /> <!-- Describes the directory where resources are stored, relative to the POM path. --> <includes /> <!-- List of inclusion patterns, e.g., */.xml. --> <excludes /> <!-- List of exclusion patterns, e.g., */.xml. --> </resource> </resources> <!-- This element describes all resource paths related to unit tests, such as property files related to unit tests. --> <testResources> <!-- This element describes all resource paths related to tests, see the description of the build/resources/resource element. --> <testResource> <targetPath /> <filtering /> <directory /> <includes /> <excludes /> </testResource> </testResources> <!-- The directory where all build-generated files are stored. --> <directory /> <!-- The file name of the generated artifact, with the default value being ${artifactId}-${version}. --> <finalName /> <!-- List of filter property files used when filtering is turned on. --> <filters /> <!-- Default plugin information that subprojects can reference. This plugin configuration is only resolved or bound to the lifecycle when referenced. Any local configuration for the plugin will override this configuration. --> <pluginManagement> <!-- List of used plugins. --> <plugins> <!-- The plugin element contains information needed to describe the plugin. --> <plugin> <groupId /> <!-- The group ID of the plugin in the repository. --> <artifactId /> <!-- The artifact ID of the plugin in the repository. --> <version /> <!-- The version (or version range) of the plugin used. --> <extensions /> <!-- Whether to download Maven extensions (such as packaging and type handlers) from this plugin. For performance reasons, this element is only set to enabled if it is actually needed. --> <executions> <!-- The execution element contains information needed for plugin execution. --> <execution>
<!-- Execution target identifier, used to identify targets during the build process or to match execution targets that need to be merged during inheritance -->
<id />
<!-- The build lifecycle phase to which the target is bound. If omitted, the target will be bound to the default phase configured in the source data -->
<phase />
<!-- Configured execution targets -->
<goals />
<!-- Configuration whether to propagate to sub-POMs -->
<inherited />
<!-- Configuration as a DOM object -->
<configuration />
</execution>
</executions>
<!-- Additional dependencies required for the project to introduce plugins -->
<dependencies>
<!-- See dependencies/dependency element -->
<dependency>
......
</dependency>
</dependencies>
<!-- Whether any configuration is propagated to sub-projects -->
<inherited />
<!-- Configuration as a DOM object -->
<configuration />
</plugin>
</plugins>
</pluginManagement>
<!-- List of used plugins -->
<plugins>
<!-- See build/pluginManagement/plugins/plugin element -->
<plugin>
<groupId />
<artifactId />
<version />
<extensions />
<executions>
<execution>
<id />
<phase />
<goals />
<inherited />
<configuration />
</execution>
</executions>
<dependencies>
<!-- See dependencies/dependency element -->
<dependency>
......
</dependency>
</dependencies>
<goals />
<inherited />
<configuration />
</plugin>
</plugins>
</build>
<!-- List of project build profiles, which, if activated, will modify the build process -->
<profiles>
<!-- Activate a specific build process based on environmental parameters or command line arguments --> <profile> <!-- Unique identifier for the build configuration. Used for command line activation and merging profiles with the same identifier during inheritance. --> <id /> <!-- Condition logic for automatically triggering the profile. Activation is the key to enabling the profile. The power of a profile comes from its ability to automatically use specific values in certain environments; these environments are specified through the activation element. Activation is not the only way to enable a profile. --> <activation> <!-- Flag indicating whether the profile is active by default --> <activeByDefault /> <!-- Profile is activated when a matching JDK is detected. For example, 1.4 activates JDK 1.4, 1.4.0_2, while !1.4 activates all JDK versions not starting with 1.4. --> <jdk /> <!-- Profile is activated when a matching operating system property is detected. The os element can define properties related to the operating system. --> <os> <!-- Name of the operating system that activates the profile --> <name>Windows XP</name> <!-- Family of the operating system that activates the profile (e.g., 'windows') --> <family>Windows</family> <!-- Architecture of the operating system that activates the profile --> <arch>x86</arch> <!-- Version of the operating system that activates the profile --> <version>5.1.2600</version> </os> <!-- Profile is activated if Maven detects a property (which can be referenced in the POM via ${name}) with the corresponding name and value. If the value field is empty, the presence of the property name field activates the profile; otherwise, it matches the property value field case-sensitively. --> <property> <!-- Name of the property that activates the profile --> <name>mavenVersion</name> <!-- Value of the property that activates the profile --> <value>2.0.3</value> </property> <!-- Provides a file name to check for existence or non-existence to activate the profile. 'missing' checks if the file does not exist to activate the profile. Conversely, 'exists' checks if the file exists to activate the profile. --> <file> <!-- Activates the profile if the specified file exists. --> <exists>/usr/local/hudson/hudson-home/jobs/maven-guide-zh-to-production/workspace/</exists> <!-- Activates the profile if the specified file does not exist. --> <missing>/usr/local/hudson/hudson-home/jobs/maven-guide-zh-to-production/workspace/</missing> </file> </activation> <!-- Information needed to build the project. See the build element --> <build> <defaultGoal /> </build> </profile>
<resources>
<resource>
<targetPath />
<filtering />
<directory />
<includes />
<excludes />
</resource>
</resources>
<testResources>
<testResource>
<targetPath />
<filtering />
<directory />
<includes />
<excludes />
</testResource>
</testResources>
<directory />
<finalName />
<filters />
<pluginManagement>
<plugins>
<!-- See build/pluginManagement/plugins/plugin element -->
<plugin>
<groupId />
<artifactId />
<version />
<extensions />
<executions>
<execution>
<id />
<phase />
<goals />
<inherited />
<configuration />
</execution>
</executions>
<dependencies>
<!-- See dependencies/dependency element -->
<dependency>
......
</dependency>
</dependencies>
<goals />
<inherited />
<configuration />
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- See build/pluginManagement/plugins/plugin element --> <plugin> <groupId /> <artifactId /> <version /> <extensions /> <executions> <execution> <id /> <phase /> <goals /> <inherited /> <configuration /> </execution> </executions> <dependencies> <!-- See dependencies/dependency element --> <dependency> ...... </dependency> </dependencies> <goals /> <inherited /> <configuration /> </plugin> </plugins> </build> <!-- Modules (sometimes referred to as subprojects) are built as part of the project. Each listed module element is a relative path to the module's directory --> <modules /> <!-- List of remote repositories to discover dependencies and extensions --> <repositories> <!-- See repositories/repository element --> <repository> <releases> <enabled /> <updatePolicy /> <checksumPolicy /> </releases> <snapshots> <enabled /> <updatePolicy /> <checksumPolicy /> </snapshots> <id /> <name /> <url /> <layout /> </repository> </repositories> <!-- List of remote repositories to discover plugins for building and reporting --> <pluginRepositories> <!-- Contains information needed to connect to remote plugin repositories. See repositories/repository element --> <pluginRepository> <releases> <enabled /> <updatePolicy /> <checksumPolicy /> </releases> <snapshots> <enabled /> <updatePolicy /> <checksumPolicy /> </snapshots> <id /> <name /> <url /> <layout /> </pluginRepository> </pluginRepositories> <!--This element describes all dependencies related to the project. These dependencies form the various stages of the project build process. They are automatically downloaded from the repository defined by the project. For more information, see the project dependency mechanism. --> <dependencies> <!--See the dependencies/dependency element --> <dependency> ...... </dependency> </dependencies> <!--Deprecated. Maven now ignores this element. --> <reports /> <!--This element includes the specifications for generating reports using reporting plugins. When the user executes "mvn site", these reports will run. All report links can be found in the navigation bar of the page. See the reporting element --> <reporting> ...... </reporting> <!--See the dependencyManagement element --> <dependencyManagement> <dependencies> <!--See the dependencies/dependency element --> <dependency> ...... </dependency> </dependencies> </dependencyManagement> <!--See the distributionManagement element --> <distributionManagement> ...... </distributionManagement> <!--See the properties element --> <properties /> </profile> </profiles> <!--Modules (sometimes referred to as subprojects) are built as part of the project. Each listed module element is a relative path to the directory of that module --> <modules /> <!--A list of remote repositories for discovering dependencies and extensions. --> <repositories> <!--Information needed to connect to the remote repository --> <repository> <!--How to handle the download of release versions from the remote repository --> <releases> <!--true or false indicates whether the repository is enabled for downloading a certain type of artifact (release, snapshot). --> <enabled /> <updatePolicy /> <!-- Specifies the frequency of updates. Maven compares the timestamps of the local POM and the remote POM. Options are: always, daily (default), interval:X (where X is a time interval in minutes), or never. --> <checksumPolicy /> <!-- What to do when Maven fails to validate the artifact checksum file: ignore, fail, or warn. --> </releases> <!-- How to handle the download of snapshot versions from the remote repository. With releases and snapshots configurations, the POM can adopt different strategies for each type of artifact in each individual repository. For example, one might decide to enable snapshot downloads only for development purposes. See repositories/repository/releases element --> <snapshots> <enabled /> <updatePolicy /> <checksumPolicy /> </snapshots> <!-- Unique identifier for the remote repository. Can be used to match a remote repository configured in the settings.xml file --> <id>banseon-repository-proxy</id> <!-- Name of the remote repository --> <name>banseon-repository-proxy</name> <!-- URL of the remote repository, in the format protocol://hostname/path --> <url>http://192.168.1.169:9999/repository/</url> <!-- Repository layout type for locating and sorting artifacts - can be default (default) or legacy. Maven 2 provides a default layout for its repositories; however, Maven 1.x had a different layout. This element specifies whether the layout is default or legacy. --> <layout>default</layout> </repository> </repositories> <!-- List of remote repositories for discovering plugins used in building and reporting --> <pluginRepositories> <!-- Information to connect to remote plugin repositories. See repositories/repository element --> <pluginRepository> ...... </pluginRepository> </pluginRepositories>
<!-- This element describes all dependencies related to the project. These dependencies are part of the project's build process and are automatically downloaded from the project's defined repositories. For more information, see the project dependency mechanism. --> <dependencies> <dependency> <!-- Group ID of the dependency --> <groupId>org.apache.maven</groupId> <!-- Artifact ID of the dependency --> <artifactId>maven-artifact</artifactId> <!-- Version number of the dependency. In Maven 2, version ranges can also be configured. --> <version>3.8.1</version> <!-- Dependency type, default is jar. It usually represents the file extension of the dependency, but there are exceptions. A type can be mapped to another extension or classifier. Types often correspond to the packaging method used, although there are exceptions. Examples of types include: jar, war, ejb-client, and test-jar. If extensions are set to true, new types can be defined in plugins. Therefore, the list of types provided is not exhaustive. --> <type>jar</type> This is a Chinese to English translation. Please provide the English translation for this text. Do not provide any explanations or text apart from the translation. Chinese: <!-- Classifier. Classifiers can distinguish artifacts that belong to the same POM but have different build methods. The classifier name is appended after the version number in the file name. For example, if you want to build two separate artifacts into JARs, one using the Java 1.4 compiler and the other using the Java 6 compiler, you can use classifiers to generate two separate JAR artifacts. --> <classifier></classifier> <!-- Dependency scope. Helps determine which artifacts are included in the project during the release process. For more details, refer to the dependency mechanism. - compile: Default scope, used for compilation - provided: Similar to compile, but expects the JDK or container to provide, similar to classpath - runtime: Required for execution - test: Used during test tasks - system: Requires external provision of elements. Obtained via systemPath - systemPath: Only used for system scope. Provides the corresponding path - optional: When the project itself is dependent, marks whether the dependency is transitive. Used for continuous dependencies --> <scope>test</scope> <!-- For system scope use only. Note, this element is discouraged and may be overridden in new versions. This element specifies a path on the filesystem for the dependency. Requires an absolute path rather than a relative path. It is recommended to use properties to match absolute paths, such as ${java.home}. --> <systemPath></systemPath> <!-- When calculating transitive dependencies, lists the set of excluded dependency artifacts from the dependency artifact list. This tells Maven that you only depend on the specified project, not the project's dependencies. This element is mainly used to resolve version conflict issues --> <exclusions> <exclusion> <artifactId>spring-core</artifactId> <groupId>org.springframework</groupId> </exclusion> </exclusions> <!-- Optional dependency. If you declare C as optional in project B, you need to explicitly reference the dependency on C in projects that depend on B (such as project A). Optional dependencies block transitive dependency. --> <optional>true</optional> </dependency> </dependencies> <!-- Deprecated. Maven now ignores this element. --> <reports></reports> <!-- This element describes the specifications for generating reports using report plugins. When the user executes "mvn site", these reports will run. All report links will be available in the navigation bar. --> <reporting> <!-- If true, the website will not include default reports. This includes reports in the "Project Information" menu. --> <excludeDefaults /> <!-- Where all generated reports are stored. The default value is ${project.build.directory}/site. --> <outputDirectory /> <!-- The report plugins used and their configurations. --> <plugins> <!-- The plugin element contains information needed to describe the report plugin --> <plugin> <!-- The group ID of the report plugin in the repository --> <groupId /> <!-- The artifact ID of the report plugin in the repository --> <artifactId /> <!-- The version (or version range) of the report plugin used --> <version /> <!-- Whether any configuration is propagated to subprojects --> <inherited /> <!-- Configuration of the report plugin --> <configuration /> <reportSets> <!-- Represents a collection of reports and the configuration to generate this collection --> <reportSet> <!-- Unique identifier of the report set, used when inheriting POM --> <id /> <!-- Configuration of the reports used when generating the report set --> <configuration /> <!-- Whether the configuration is inherited by sub-POMs --> <inherited /> <!-- Which reports are used in this set --> <reports /> </reportSet> </reportSets> </plugin> </plugins> </reporting> <!-- Default dependency information for all sub-projects of this project. This dependency information is not immediately resolved. Instead, when a sub-project declares a dependency (must describe group ID and artifact ID), if some information other than group ID and artifact ID is not described, it matches the dependency here via group ID and artifact ID and uses the dependency information here. --> <dependencyManagement> <dependencies> <!-- See dependencies/dependency element --> <dependency> ...... </dependency> </dependencies> </dependencyManagement> <!-- Project distribution information, indicating the location to be published after executing mvn deploy. With this information, websites can be deployed to remote servers or artifacts can be deployed to remote repositories. --> <distributionManagement> <repository> <!-- Whether to assign a unique version number (timestamp and build number) to snapshots or to use the same version number each time? See repositories/repository element --> <uniqueVersion /> <id>banseon-maven2</id> <name>banseon maven2</name> <url>file://${basedir}/target/deploy</url> <layout /> </repository> <!-- Where to deploy snapshot artifacts? If this element is not configured, it defaults to the repository configured in the distributionManagement/repository element --> <snapshotRepository> <uniqueVersion /> <id>banseon-maven2</id> <name>Banseon-maven2 Snapshot Repository</name> <url>scp://svn.baidu.com/banseon:/usr/local/maven-snapshot</url> <layout /> </snapshotRepository> <!-- Information needed to deploy the project's website --> <site> <!-- Unique identifier of the deployment location, used to match the site with the configuration in settings.xml -->
<id>banseon-site</id>
<!-- Name of the deployment location -->
<name>business api website</name>
<!-- URL of the deployment location, in the format protocol://hostname/path -->
<url>
scp://svn.baidu.com/banseon:/var/www/localhost/banseon-web
</url>
</site>
<!-- URL of the project download page. If this element is not present, users should refer to the homepage. The reason for using this element is to help locate artifacts that are not in the repository (due to license restrictions). -->
<downloadUrl />
<!-- Relocation information for the artifact if it has a new group ID and artifact ID (the artifact has been moved to a new location). -->
<relocation>
<!-- New group ID for the artifact -->
<groupId />
<!-- New artifact ID for the artifact -->
<artifactId />
<!-- New version number for the artifact -->
<version />
<!-- Additional information for the user about the move, such as the reason. -->
<message />
</relocation>
<!-- State of the artifact in the remote repository. This element should not be set in the local project as it is updated automatically by the tool. Valid values are: none (default), converted (converted by the repository administrator from Maven 1 POM), partner (synchronized directly from a partner Maven 2 repository), deployed (deployed from a Maven 2 instance), verified (confirmed to be correct and final). -->
<status />
</distributionManagement>
<!-- Values replace names, Properties can be used throughout the POM, and can also be used as trigger conditions (see the activation element in the settings.xml configuration file). The format is <name>value</name>. -->
<properties />
</project>