用于发送通知邮件的身份可以自定义。它可以是 POM 的<developers>部分的成员,也可以使用插件的<mailSender>参数显式指定。
要指定使用哪个开发者发送通知,只需指定开发者的id,如下例所示:
<project>
<developers>
...
<developer>
<id>jsmith</id>
<name>John Smith</name>
<email>jsmith@foo.bar</email>
</developer>
...
</developers>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>2.8</version>
<configuration>
<fromDeveloperId>jsmith</fromDeveloperId>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
如果未指定开发者ID ,则将使用列表中的第一个<developer>。
如果执行发布的人在发布之间发生变化,您也可以从命令行执行此操作。
mvn -Dchanges.fromDeveloperId=jsmith changes:announcement-mail
如果您想明确指定发件人而不依赖 POM 的开发人员部分,请定义插件的mailSender参数。
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>2.8</version>
<configuration>
<mailSender>
<name>Release Notification</name>
<email>noreply@foo.bar</email>
</mailSender>
</configuration>
</plugin>
</plugins>
</build>
...
</project>