Search code examples
maventagsartifact

Maven <name> tag under <project>


I wonder what the <name> tag under <project> does in Maven.
Documentation describes:

name: This element indicates the display name used for the project. This is often used in Maven's generated documentation.

I usually find <name> tag defined in every single pom.xml in the project I work.
And I find it distracting, since I normally care about <artifactid> but not about <name> and both mostly have always the same string.

I guess I can simply remove them.
But just wondering about its usefulness.


Solution

  • If the <name>..</name> is not defined the artifactId will be shown there but you can of course overwrite that and show more descriptive text if you like. For example if you build Apache Maven you see different output like the following:

    [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
    

    For example the last line would be apache-maven instead of Apache Maven Distribution if no <name>..</name> would have been defined.