胃 <name> 吃下 <project>
Maven <name> tag under <project>
我想知道 <project>
下的 <name>
标签在 Maven 中的作用。
Documentation 描述:
name: This element indicates the display name used for the project. This is often used in Maven's generated documentation.
我通常会在我工作的项目中的每个 pom.xml
中找到 <name>
标签。
而且我发现它让人分心,因为我通常关心 <artifactid>
但不关心 <name>
并且两者大多总是具有相同的字符串。
我想我可以简单地删除它们。
但只是想知道它的用处。
如果未定义 <name>..</name>
,artifactId 将显示在那里,但您当然可以覆盖它并根据需要显示更多描述性文本。例如,如果您构建 Apache Maven,您会看到如下不同的输出:
[INFO] Reactor Summary for Apache Maven 3.7.0-SNAPSHOT:
[INFO]
[INFO] Apache Maven ....................................... SUCCESS [ 0.192 s]
[INFO] Maven Model ........................................ SUCCESS [ 0.047 s]
[INFO] Maven Artifact ..................................... SUCCESS [ 0.030 s]
[INFO] Maven Plugin API ................................... SUCCESS [ 0.017 s]
[INFO] Maven Builder Support .............................. SUCCESS [ 0.012 s]
[INFO] Maven Model Builder ................................ SUCCESS [ 0.054 s]
[INFO] Maven Settings ..................................... SUCCESS [ 0.012 s]
[INFO] Maven Settings Builder ............................. SUCCESS [ 0.023 s]
[INFO] Maven Repository Metadata Model .................... SUCCESS [ 0.010 s]
[INFO] Maven Artifact Resolver Provider ................... SUCCESS [ 0.021 s]
[INFO] Maven Core ......................................... SUCCESS [ 0.150 s]
[INFO] Maven SLF4J Wrapper ................................ SUCCESS [ 0.007 s]
[INFO] Maven SLF4J Simple Provider ........................ SUCCESS [ 0.024 s]
[INFO] Maven Embedder ..................................... SUCCESS [ 0.021 s]
[INFO] Maven Compat ....................................... SUCCESS [ 0.125 s]
[INFO] Apache Maven Distribution .......................... SUCCESS [ 0.094 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.135 s
例如,如果没有定义 <name>..</name>
,最后一行将是 apache-maven
而不是 Apache Maven Distribution
。
我想知道 <project>
下的 <name>
标签在 Maven 中的作用。
Documentation 描述:
name: This element indicates the display name used for the project. This is often used in Maven's generated documentation.
我通常会在我工作的项目中的每个 pom.xml
中找到 <name>
标签。
而且我发现它让人分心,因为我通常关心 <artifactid>
但不关心 <name>
并且两者大多总是具有相同的字符串。
我想我可以简单地删除它们。
但只是想知道它的用处。
如果未定义 <name>..</name>
,artifactId 将显示在那里,但您当然可以覆盖它并根据需要显示更多描述性文本。例如,如果您构建 Apache Maven,您会看到如下不同的输出:
[INFO] Reactor Summary for Apache Maven 3.7.0-SNAPSHOT:
[INFO]
[INFO] Apache Maven ....................................... SUCCESS [ 0.192 s]
[INFO] Maven Model ........................................ SUCCESS [ 0.047 s]
[INFO] Maven Artifact ..................................... SUCCESS [ 0.030 s]
[INFO] Maven Plugin API ................................... SUCCESS [ 0.017 s]
[INFO] Maven Builder Support .............................. SUCCESS [ 0.012 s]
[INFO] Maven Model Builder ................................ SUCCESS [ 0.054 s]
[INFO] Maven Settings ..................................... SUCCESS [ 0.012 s]
[INFO] Maven Settings Builder ............................. SUCCESS [ 0.023 s]
[INFO] Maven Repository Metadata Model .................... SUCCESS [ 0.010 s]
[INFO] Maven Artifact Resolver Provider ................... SUCCESS [ 0.021 s]
[INFO] Maven Core ......................................... SUCCESS [ 0.150 s]
[INFO] Maven SLF4J Wrapper ................................ SUCCESS [ 0.007 s]
[INFO] Maven SLF4J Simple Provider ........................ SUCCESS [ 0.024 s]
[INFO] Maven Embedder ..................................... SUCCESS [ 0.021 s]
[INFO] Maven Compat ....................................... SUCCESS [ 0.125 s]
[INFO] Apache Maven Distribution .......................... SUCCESS [ 0.094 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.135 s
例如,如果没有定义 <name>..</name>
,最后一行将是 apache-maven
而不是 Apache Maven Distribution
。