13

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?

1
  • 3
    +1 (mostly for choosing the name chupacabras ) :-) Commented Jun 9, 2010 at 9:27

2 Answers 2

13

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>
0
9

When invoked from command line, the following will work:

mvn -Duser.name=<username> clean install

In NetBeans 7.4 you can set up the user name globally in the following way: Tools -> Options -> Java -> Maven, Selecting "Execution" category on the left and setting

Global Execution Options:

-Duser.name=<username>

Alternatively it can be done by setting according property in project-specific build action settings (Project Properties -> Actions -> e.g. Build project).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.