Maven Release Plugin — Difference Between “preparationGoals” and “goals” in configuration
Maven Release Plugin lets you release your project easily. However, often during release you want to perform some additional goals. For example, copy the artifact to another server.
There are several ways to do that. Among those is possibility to define goals during Maven release by adding goals or preparationGoals in configuration.
What is the difference between those? When you specify goals, you take over the deployment phase. I mean if you want to run some maven task1 task2 and then still continue deploying your released artifact to the repository, you need to specify the following:
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
<configuration>
<goals>task1 task2 deploy</goals>
</configuration>
</plugin>
But if you want to do some additional task, it is better to use preparationGoals. Released artifact anyway will be deployed to the repository, so you don't need to specify deploy explicitly.
Moreover, preprationGoals are activated just before the commit.