Skip to content

Commit aaa221c

Browse files
committed
Migrate Mojo to KeyStore API
1 parent 81ff9a2 commit aaa221c

File tree

110 files changed

+4403
-8889
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+4403
-8889
lines changed

generate-certs.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

pom.xml

Lines changed: 22 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
</contributors>
8181

8282
<prerequisites>
83-
<maven>${mavenVersion}</maven>
83+
<maven>3.9</maven>
8484
</prerequisites>
8585

8686
<scm>
@@ -100,124 +100,58 @@
100100
</site>
101101
</distributionManagement>
102102

103-
<properties />
104-
105-
<dependencyManagement>
106-
<dependencies>
107-
<dependency>
108-
<groupId>org.apache.maven</groupId>
109-
<artifactId>maven-plugin-api</artifactId>
110-
<version>${mavenVersion}</version>
111-
</dependency>
112-
<dependency>
113-
<groupId>org.apache.maven.shared</groupId>
114-
<artifactId>maven-shared-utils</artifactId>
115-
<version>3.4.2</version>
116-
</dependency>
117-
<dependency>
118-
<groupId>org.codehaus.plexus</groupId>
119-
<artifactId>plexus-utils</artifactId>
120-
<version>4.0.2</version>
121-
</dependency>
122-
<dependency>
123-
<groupId>org.codehaus.plexus</groupId>
124-
<artifactId>plexus-container-default</artifactId>
125-
<version>2.1.1</version>
126-
<scope>provided</scope>
127-
</dependency>
128-
<dependency>
129-
<groupId>org.apache.commons</groupId>
130-
<artifactId>commons-lang3</artifactId>
131-
<version>3.20.0</version>
132-
</dependency>
133-
<dependency>
134-
<groupId>org.slf4j</groupId>
135-
<artifactId>slf4j-api</artifactId>
136-
<version>1.7.36</version>
137-
<scope>provided</scope>
138-
</dependency>
139-
140-
<dependency>
141-
<groupId>org.codehaus.plexus</groupId>
142-
<artifactId>plexus-component-annotations</artifactId>
143-
<version>2.2.0</version>
144-
<scope>provided</scope>
145-
</dependency>
146-
</dependencies>
147-
</dependencyManagement>
103+
<properties>
104+
<bouncycastle.version>1.83</bouncycastle.version>
105+
</properties>
148106

149107
<dependencies>
150108
<dependency>
151109
<groupId>org.apache.maven</groupId>
152110
<artifactId>maven-plugin-api</artifactId>
153-
<scope>provided</scope>
154-
</dependency>
155-
<dependency>
156-
<groupId>org.apache.maven</groupId>
157-
<artifactId>maven-core</artifactId>
158111
<version>${mavenVersion}</version>
159112
<scope>provided</scope>
160113
</dependency>
161114
<dependency>
162115
<groupId>org.apache.maven.plugin-tools</groupId>
163116
<artifactId>maven-plugin-annotations</artifactId>
164117
</dependency>
165-
166118
<dependency>
167-
<groupId>org.apache.maven.shared</groupId>
168-
<artifactId>maven-shared-utils</artifactId>
119+
<groupId>org.bouncycastle</groupId>
120+
<artifactId>bcprov-jdk18on</artifactId>
121+
<version>${bouncycastle.version}</version>
169122
</dependency>
170123
<dependency>
171-
<groupId>commons-io</groupId>
172-
<artifactId>commons-io</artifactId>
173-
<version>2.21.0</version>
124+
<groupId>org.bouncycastle</groupId>
125+
<artifactId>bcpkix-jdk18on</artifactId>
126+
<version>${bouncycastle.version}</version>
174127
</dependency>
175128
<dependency>
176-
<groupId>org.apache.commons</groupId>
177-
<artifactId>commons-lang3</artifactId>
178-
</dependency>
179-
<dependency>
180-
<groupId>org.codehaus.plexus</groupId>
181-
<artifactId>plexus-utils</artifactId>
129+
<groupId>org.slf4j</groupId>
130+
<artifactId>slf4j-api</artifactId>
131+
<version>1.7.36</version>
132+
<scope>provided</scope>
182133
</dependency>
183-
184134
<dependency>
185-
<groupId>junit</groupId>
186-
<artifactId>junit</artifactId>
135+
<groupId>org.junit.jupiter</groupId>
136+
<artifactId>junit-jupiter</artifactId>
187137
<scope>test</scope>
188138
</dependency>
189139
<dependency>
190-
<groupId>org.mockito</groupId>
191-
<artifactId>mockito-core</artifactId>
192-
<version>4.11.0</version>
193-
<scope>test</scope>
140+
<groupId>javax.inject</groupId>
141+
<artifactId>javax.inject</artifactId>
142+
<version>1</version>
194143
</dependency>
195144
</dependencies>
196145

197146
<build>
198-
<pluginManagement>
199-
<plugins>
200-
<plugin>
201-
<groupId>org.codehaus.plexus</groupId>
202-
<artifactId>plexus-component-metadata</artifactId>
203-
<version>2.2.0</version>
204-
</plugin>
205-
<plugin>
206-
<groupId>org.codehaus.plexus</groupId>
207-
<artifactId>plexus-maven-plugin</artifactId>
208-
<version>1.3.8</version>
209-
</plugin>
210-
</plugins>
211-
</pluginManagement>
212-
213147
<plugins>
214148
<plugin>
215-
<groupId>org.codehaus.plexus</groupId>
216-
<artifactId>plexus-component-metadata</artifactId>
149+
<groupId>org.eclipse.sisu</groupId>
150+
<artifactId>sisu-maven-plugin</artifactId>
217151
<executions>
218152
<execution>
219153
<goals>
220-
<goal>generate-metadata</goal>
154+
<goal>main-index</goal>
221155
</goals>
222156
</execution>
223157
</executions>

src/it/MKEYTOOL-10/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
L=Herzele, ST=VL, o=FrankCornelis, c=BE
4646
</dname>
4747
<keyalg>ec</keyalg>
48+
<keysize>256</keysize>
4849
<keypass>secret</keypass>
4950
<storepass>secret</storepass>
5051
<alias>alias</alias>

src/main/java/org/codehaus/mojo/keytool/AbstractKeyToolMojo.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* limitations under the License.
1717
*/
1818

19+
import java.io.File;
1920
import java.text.MessageFormat;
2021
import java.util.ResourceBundle;
2122

@@ -41,7 +42,7 @@ public abstract class AbstractKeyToolMojo extends AbstractMojo {
4142

4243
/**
4344
* Enable verbose mode (in mojo and in keytool command).
44-
* See <a href="http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/keytool.html#Commands">options</a>.
45+
* See <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/keytool.html">keytool options</a>.
4546
*/
4647
@Parameter(defaultValue = "false")
4748
private boolean verbose;
@@ -129,4 +130,21 @@ protected String getMessage(final String key, final Object arg) {
129130
protected String getMessage(final String key, final Object arg1, final Object arg2) {
130131
return getMessage(key, new Object[] {arg1, arg2});
131132
}
133+
134+
/**
135+
* Create the parent directory of the given file location.
136+
*
137+
* @param file file location to check
138+
*/
139+
protected void createParentDirIfNecessary(final String file) {
140+
if (file != null) {
141+
final File fileDir = new File(file).getParentFile();
142+
143+
if (fileDir != null) {
144+
// not a relative path
145+
boolean mkdirs = fileDir.mkdirs();
146+
getLog().debug("mdkirs: " + mkdirs + " " + fileDir);
147+
}
148+
}
149+
}
132150
}

0 commit comments

Comments
 (0)