pom.xml中$ {project.basedir}的含义

时间:2023-01-25 11:06:38

What is the meaning of

是什么意思

<directory>${project.basedir}</directory>

and

${project.build.directory}

in pom.xml

在pom.xml中

2 个解决方案

#1


19  

There are a set of available properties to all Maven projects.

所有Maven项目都有一组可用的属性。

From Introduction to the POM:

从POM简介:

project.basedir: The directory that the current project resides in.

project.basedir:当前项目所在的目录。

This means this points to where your Maven projects resides on your system. It corresponds to the location of the pom.xml file. If your POM is located inside /path/to/project/pom.xml then this property will evaluate to /path/to/project.

这意味着这指向Maven项目驻留在系统上的位置。它对应于pom.xml文件的位置。如果您的POM位于/path/to/project/pom.xml内,则此属性将评估为/ path / to / project。

Some properties are also inherited from the Super POM, which is the case for project.build.directory. It is the value inside the <project><build><directory> element of the POM. You can get a description of all those values by looking at the Maven model. For project.build.directory, it is:

某些属性也从Super POM继承,这是project.build.directory的情况。它是POM的 元素内的值。您可以通过查看Maven模型来获得所有这些值的描述。对于project.build.directory,它是:

The directory where all files generated by the build are placed. The default value is target.

放置构建生成的所有文件的目录。默认值为target。

This is the directory that will hold every generated file by the build.

这是将通过构建保存每个生成的文件的目录。

#2


7  

${project.basedir} is the root directory of your project.

$ {project.basedir}是项目的根目录。

${project.build.directory} is equivalent to ${project.basedir}/target

$ {project.build.directory}相当于$ {project.basedir} / target

as it is defined here: https://github.com/apache/maven/blob/trunk/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml#L53

如下所示:https://github.com/apache/maven/blob/trunk/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml# L53

#1


19  

There are a set of available properties to all Maven projects.

所有Maven项目都有一组可用的属性。

From Introduction to the POM:

从POM简介:

project.basedir: The directory that the current project resides in.

project.basedir:当前项目所在的目录。

This means this points to where your Maven projects resides on your system. It corresponds to the location of the pom.xml file. If your POM is located inside /path/to/project/pom.xml then this property will evaluate to /path/to/project.

这意味着这指向Maven项目驻留在系统上的位置。它对应于pom.xml文件的位置。如果您的POM位于/path/to/project/pom.xml内,则此属性将评估为/ path / to / project。

Some properties are also inherited from the Super POM, which is the case for project.build.directory. It is the value inside the <project><build><directory> element of the POM. You can get a description of all those values by looking at the Maven model. For project.build.directory, it is:

某些属性也从Super POM继承,这是project.build.directory的情况。它是POM的 元素内的值。您可以通过查看Maven模型来获得所有这些值的描述。对于project.build.directory,它是:

The directory where all files generated by the build are placed. The default value is target.

放置构建生成的所有文件的目录。默认值为target。

This is the directory that will hold every generated file by the build.

这是将通过构建保存每个生成的文件的目录。

#2


7  

${project.basedir} is the root directory of your project.

$ {project.basedir}是项目的根目录。

${project.build.directory} is equivalent to ${project.basedir}/target

$ {project.build.directory}相当于$ {project.basedir} / target

as it is defined here: https://github.com/apache/maven/blob/trunk/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml#L53

如下所示:https://github.com/apache/maven/blob/trunk/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml# L53