Assuming you are using the maven release plugin for your releases, you can accomplish this by placing the activation profile that it activates from there.
You can also do this with your own profiles if you prefer or don't use the release plugin for your releases.
In your pom you would include:
<profiles> <profile> <id>release-profile</id> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jarsigner-plugin</artifactId> ... </plugin> </profile> </profiles>
Now leave the TSA argument stuff in the normal part of the build / plugin configuration for jarsigner. If for some reason you wanted the TSA with a snapshot for some reason, you can manually activate the release profile using:
mvn -Prelease-profile install
source share