Skip to content

Commit 26b05ec

Browse files
committed
Fixed compilation problem with maven
1 parent 0414447 commit 26b05ec

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ This project try to simplify common operation with KeyTools such as:
77
* generate a new *Certificate Sign Request* (**CSR**)
88
* sign a CSR and produce a **certification chain** (p7b)
99

10+
##### NB:
11+
In order to reduce dependencies, some classes of `sun.security` package has been used:
12+
may not compile on JDKs different than OpenJDK/Oracle.
13+
1014
## How to use
1115

1216
Code is better than thousand words: check out [`KeyToolsTest`](https://github.com/andreacomo/keytool-helper/blob/master/src/test/java/it/codingjam/keytool/services/KeyToolsTest.java)!

pom.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,22 @@
3232
</dependency>
3333
</dependencies>
3434

35+
<build>
36+
<plugins>
37+
<plugin>
38+
<groupId>org.apache.maven.plugins</groupId>
39+
<artifactId>maven-compiler-plugin</artifactId>
40+
<version>3.5.1</version>
41+
<configuration>
42+
<source>${java.version}</source>
43+
<target>${java.version}</target>
44+
<compilerArgs>
45+
<arg>-XDignore.symbol.file</arg>
46+
</compilerArgs>
47+
<fork>true</fork>
48+
</configuration>
49+
</plugin>
50+
</plugins>
51+
</build>
52+
3553
</project>

src/test/java/it/codingjam/keytool/services/KeyToolsTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.junit.rules.ExpectedException;
99
import org.springframework.util.FileCopyUtils;
1010

11+
import java.io.File;
1112
import java.io.FileOutputStream;
1213
import java.io.InputStream;
1314
import java.io.InputStreamReader;
@@ -42,6 +43,10 @@ public void shouldGenerateKeyStoreWithKeyPair() throws Exception {
4243
.build()
4344
.createInKeyStore("test", "456")
4445
.writeTo(out);
46+
} finally {
47+
File keyStoreFile = new File("test.ks");
48+
assertTrue(keyStoreFile.exists());
49+
assertTrue(keyStoreFile.delete());
4550
}
4651
}
4752

0 commit comments

Comments
 (0)