Maven built-in properties

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.