Most of the entire (fan) (Yi) from the MAVEN official website of the doc Introduction to POM https://maven.apache.org/guides/introduction/introduction-to-the-pom.html
The POM (Project Obeject Model) is the most basic component unit in a MAVEN project,
1. Variables in the project variable/pom;
All elements that have only a single value can be used as variables. ${project.build.sourcedirectory}, ${project.groupid},${project.version}, the variables are prefixed with project, if they are prefixed with pom or are not prefixed at all, Do not use it because this form has been marked as obsolete (@deprecated)
Special variables (special Variables)
${project.basedir} directory where the current project is located
${project.baseuri} The directory in which the current project is located, presented as a URI and available after Maven 2.1.0
${maven.build.timestamp} timestamp represents the build start time, which is available after Maven 2.1.0-m
The ${maven.build.timestamp} timestamp can be interpreted as a specific time-date format, but the ' Maven.build.timestamp.format ' attribute is declared in the project <project> block. The code is as follows:
1 <Project>2 ...3 <Properties>4 <Maven.build.timestamp.format>Yyyy-mm-dd ' T ' HH:mm:ss ' Z '</Maven.build.timestamp.format>5 </Properties>6 ...7 </Project>
The specified format of ' Maven.build.timestamp.format ' is consistent with the format in ' Java.text.SimpleDateFormat '. If ' Maven.build.timestamp.format ' is not specified, then the default time-date format is the format of the code shown above.
You can also use the properties defined in the project as a variable. The example given by the official website Doc is to use the <properties> definition ' mavenversion ' as a variable.
1 <Project>2 ...3 <Properties>4 <mavenversion>2.1</mavenversion>5 </Properties>6 <Dependencies>7 <Dependency>8 <groupId>Org.apache.maven</groupId>9 <Artifactid>Maven-artifact</Artifactid>Ten <version>${mavenversion}</version> One </Dependency> A <Dependency> - <groupId>Org.apache.maven</groupId> - <Artifactid>Maven-project</Artifactid> the <version>${mavenversion}</version> - </Dependency> - </Dependencies> - ... + </Project>
2. Project inheritance concept, with example;
3. Project aggregation concept, with example;
Some knowledge of Maven Pom