Utilities for manipulating JKS files.
Status: released to Maven Central
Jks.removeExpiringCertificates(file, password, expiryTime)
Jdk.main
with arguments"removeExpiring", "<filename>", "<password>", "<days-to-expire-from-now>"
Add this to your pom.xml:
<dependencies>
<dependency>
<groupId>com.github.davidmoten</groupId>
<artifactId>jks-util</artifactId>
<version>VERSION_HERE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>com.github.davidmoten.jks.Jks</mainClass>
<arguments>
<argument>removeExpiring</argument>
<argument>src/main/jks/cacerts.jks</argument>
<argument>changeit</argument>
<argument>90</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Then call mvn exec:java