36

The Maven documentation talks about a property called project.build.finalName, but I couldn't find a definition of the value it is set to based on other values in the pom.xml.

How is the value of project.build.finalName computed in absence of an overriding property definition in the pom.xml?

Feuermurmel
  • 9,490
  • 10
  • 60
  • 90

4 Answers4

40

Google that... Look at the Maven POM reference: http://maven.apache.org/pom.html#BaseBuild_Element

finalName: This is the name of the bundled project when it is finally built (sans the file extension, for example: my-project-1.0.jar). It defaults to ${artifactId}-${version}. The term "finalName" is kind of a misnomer, however, as plugins that build the bundled project have every right to ignore/modify this name (but they usually do not). For example, if the maven-jar-plugin is configured to give a jar a classifier of test, then the actual jar defined above will be built as my-project-1.0-test.jar.

Dan
  • 1,955
  • 17
  • 21
  • 18
    When I am googling this is the first link!! – qartal Jun 28 '16 at 00:19
  • 1
    @qartal not surprising. That said, the POM reference material is relatively solid. – Dan Jun 28 '16 at 23:39
  • 1
    Yes, it is a misnomer. It should have been `finalBaseName`. One should file an issue and we will put this into consideration for model version 5.0.0. – Michael-O Dec 05 '20 at 15:32
15

In the Eclipse Maven POM Editor, the "Effective POM" tab, you can see the value explicitly.

R.D. Alkire
  • 502
  • 1
  • 5
  • 14
5

In the IntelliJ Idea, Right-click on the project top folder and then click Maven => Show Effective POM to view the effective pom file. In that file, search for "finalName" to know it.

Balachandar
  • 392
  • 5
  • 8
  • 1
    Welcome to StackOverflow! This seems to be a more recent feature of IntelliJ IDEA. I did not yet have a chance to get back to Java development. – Feuermurmel Apr 07 '17 at 10:24
  • 1
    This just uses `mvn help:effective-pom`, IntelliJ is only displaying the result. – Matthew Read Jun 24 '21 at 00:09
2

The final value is composed of the artifact groupId concatenated to the artifact id that you have declared in your pom.xml file

Ali HAMDI
  • 365
  • 1
  • 11