Maven - from where is "Release-Name" field data retrieved while creating MANIFEST.MF

102 Views Asked by At

We are using Jenkins maven plugin for building and deploying war applications. In the jenkinsfile we have the command (I removed the list of profiles for the sake of simplicity):

mvn release:clean release:prepare -P<profiles> -U -DautoVersionSubmodules="true" -Darguments="-T 1C -DskipTests=true" -V --batch-mode --errors

The built war artifact has MANIFEST.MF file with field Release-Name set to main.

Release-Name: main

In the parent pom.xml there are some extra settings for customize MANIFEST.MF but it seems to me that "Release-Name" is added by default because it is not listed below:

<manifestEntries>
   <Version>${project.version}</Version>
   <Revision-Number>${buildNumber}</Revision-Number>
   <Branch>${GIT_BRANCH}</Branch>
   <Local-Branch>${scmBranch}</Local-Branch>
</manifestEntries>

So I tried to look into the maven release plugin source code from this repository but I couldn't find anything helpful. Then the main question is how the field "Release-Name" is filled because I'd like to change it into some more meaningful value.

1

There are 1 best solutions below

0
Mirek Krenc On

The problem, as it turned out, was in another module of the project, which was downloaded from remote repository, while building the entire artifact. In this extra module, there was a definition in pom used to set the value of Release-Name in the manifestEntries section.

<Release-Name>${releaseName}</Release-Name>