Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set name of author in a maven project?

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?

like image 707
Chupacabras Avatar asked Jun 09 '10 09:06

Chupacabras


People also ask

What is name tag in maven?

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.

What does mvn clean command do?

1. mvn clean. This command cleans the maven project by deleting the target directory.

Can you give some basic commands used in maven project?

mvn compile: This command is used to compile the project's source code. mvn clean: Here, the project is cleaned to remove all previous-build files generated. mvn test: With this command, one can run project testing steps. mvn test-compile: This command is used to compile the code from the test source.

What is maven dependency?

Maven is chiefly used for Java-based projects, helping to download dependencies, which refers to the libraries or JAR files. The tool helps get the right JAR files for each project as there may be different versions of separate packages.


1 Answers

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>
like image 190
djsutho Avatar answered Sep 19 '22 14:09

djsutho