Brief examples on how to use the keytool:genkey and keytool:clean goals. For full documentation, click here.
<project>
...
<packaging>pom</packaging>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>keytool-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>genkey</goal>
</goals>
</execution>
</executions>
<configuration>
<keystore>keystore</keystore>
<dname>cn=www.example.com, ou=None, L=Seattle, ST=Washington, o=ExampleOrg, c=US</dname>
<keypass>m2m2m2</keypass>
<storepass>m2m2m2</storepass>
</configuration>
</plugin>
</plugins>
</build>
</project>mvn keytool:genkey -Dkeystore=/path/to/your/keystore -Dstorepass=yourstorepassword -Dalias=youralias
Brief examples on how to use the keytool:clean goal.
<project>
...
<packaging>pom</packaging>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>keytool-maven-plugin</artifactId>
<executions>
<execution>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
<configuration>
<keystore>/path/to/your/keystore</keystore>
</configuration>
</plugin>
</plugins>
</build>
</project>mvn keytool:clean [-Dkeystore=...]