Цель отправки почты Maven позволяет отправлять почту во время сборки, по желанию вы также можете добавлять вложения. Вы можете добавить ниже цель к вам pom.xml. В теге include вы должны указать относительный путь к файлам, которые вы хотите отправить.
<plugin>
<groupId>ch.fortysix</groupId>
<artifactId>maven-postman-plugin</artifactId>
<executions>
<execution>
<id>send a mail</id>
<phase>package</phase>
<goals>
<goal>send-mail</goal>
</goals>
<inherited>false</inherited>
<configuration>
<from>builder@myhost.com</from>
<subject>a subject</subject>
<failonerror>true</failonerror>
<mailhost>mail.dummy.ch</mailhost>
<mailuser>XXXXX</mailuser>
<mailpassword>XXXXX</mailpassword>
<htmlMessageFile>src/main/MailContent.html</htmlMessageFile>
<receivers>
<receiver>dani</receiver>
<receiver>sam@any-company.com</receiver>
</receivers>
<fileSets>
<fileSet>
<directory>${basedir}/src/main</directory>
<includes>
<include>**/*.pdf</include>
</includes>
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>