There are 6 types of MAVEN properties:
built-in properties (Maven pre-defined, user can use directly)
${basedir} indicates the project root directory, which is the directory containing the Pom.xml file;
${version} indicates the project version;
${project.basedir} with ${basedir};
${project.baseuri} indicates the project file address;
${maven.build.timestamp} indicates the project component start time;
${maven.build.timestamp.format} represents the presentation format of the property ${maven.build.timestamp}, and the default value is YYYYMMDD-HHMM, which can be customized in its format. The type can refer to Java.text.SimpleDateFormat. Use the following:
|
< properties < span>
< maven.build.timestamp.format > yyyy-mm-dd hh:mm:ss</ >
</ Properties >
|
Pom Properties (Use the Pom property to refer to the value of the corresponding element of the Pom.xml file)
${project.build.directory} represents the main source path;
${project.build.sourceencoding} indicates the encoding format of the main source code;
${project.build.sourcedirectory} represents the main source path;
${project.build.finalname} indicates the output file name;
${project.version} indicates the project version, same as ${version};
Custom Properties (Maven attributes defined under the <properties> tab of the Pom.xml file)
|
< project < span>
< properties
< my.pro < span> abc >
< / properties
</ Project >
|
Use this property value elsewhere using ${my.pro}.
settings.xml File Properties (in the same vein as the POM attribute, users use settings. ) The Starting property references the XML element value in the settings.xml file)
${settings.localrepository} indicates the address of the local warehouse;
Java System Properties (All Java system attributes can be referenced using the MAVEN attribute)
Use the MVN help:system command to view all Java System properties;
System.getproperties () can get all the Java attributes;
${user.home} represents the user directory;
environment variable Properties (All environment variables can be used for env. The MAVEN attribute reference at the beginning)
Use the MVN help:system command to view all environment variables;
${env. Java_home} represents the value of the JAVA_HOME environment variable;
Refer to the following:
Http://maven.apache.org/guides/introduction/introduction-to-the-pom.html
Http://maven.apache.org/pom.html
Http://maven.apache.org/settings.html
This article is from the "Jodyrex" blog, make sure to keep this source http://503431920.blog.51cto.com/6681280/1888977
Maven built-in properties