How to set name of author in a maven project?

Chupacabras picture Chupacabras · Jun 9, 2010 · Viewed 9.4k times · Source

packaged maven project contains META-INF/manifest.mf file and in field "Built-by" is login name of current user. Where or what to set name of author, so maven will use this instead of login name?

Answer

djsutho picture djsutho · Sep 30, 2014

This can be overwritten in your pom.xml by adding a manifestEntries section e.g.:

<project ...>
...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <archive>
            <index>true</index>
            <manifest>
              <addClasspath>true</addClasspath>
            </manifest>
            <manifestEntries>
              <Built-By>${user.name}</Built-By>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>