打包的 maven 项目包含 META-INF/manifest.mf 文件,在“Built-by”字段中是当前用户的登录名。
在哪里或什么设置作者的名字,所以 maven 将使用这个而不是登录名?
最佳答案
这可以通过添加 manifestEntries
在你的 pom.xml 中覆盖。部分例如:
<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>
关于maven-2 - 如何在 Maven 项目中设置作者姓名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3004369/