Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the attribute variables in the Maven pom file

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what are the attribute variables in the Maven pom file". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "What are the attribute variables in the Maven pom file"!

Maven pom file attribute variable summary 1. Built-in attributes

${basedir} indicates the current project root directory

${version} indicates the current project version

2. POM attributes

${project.artifactId} is equivalent to the value of the element

Personal understanding, essentially each tag is implemented by reference to the object, there are also inheritance characteristics (only personal understanding, for reference).

By analogy, you can find many definitions of attributes in this category.

similarly

${project.build.sourceDirectory}: The main source directory for a project defaults to src/main/java/.

${project.build.testSourceDirectory}: The default test source directory for the project is/src/test/java/.

${project.build.directory}: The project build output directory defaults to target/.

${project.build.outputDirectory}: The default output directory for the project master code compilation is target/classes/.

${project.build.testOutputDirectory}: project test code compilation output directory defaults to target/testclasses/.

When you create a maven project, maven management will automatically set the *directory value for you according to the underlying convention. You can open the pom.xml file through the IDE tool, click Effective POM, and you will see the default settings as shown in the figure.

3. custom properties

You can define a tag element yourself and set the corresponding value, so that you can apply this tag-key pair in the pom.xml, for example:

Maven pom variable definition defining variables and assigning values 4.1.5

use

org.springframework spring-webmvc ${spring-framework.version}

Generally used to manage the version number of dependencies, the advantage of doing so: when the version number changes, only need to update the variables in the properties label on the line, do not have to update all dependent version numbers

Clouds.

At this point, I believe that everyone has a deeper understanding of "what are the attribute variables in the Maven pom file," so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report