@@ -33,19 +33,6 @@ the manual.
33
33
34
34
## Building
35
35
36
- *** Note 1)***
37
- The ` java.sh ` script uses a common location for the Java install location. If
38
- your Java install location is different, this could lead to an error when
39
- running ` java.sh ` . In this case, you should modify ` java.sh ` to match your
40
- environment.
41
-
42
- Build targets for ant are :
43
- * ** ant build** (only builds the jar necessary for an app to use)
44
- * ** ant test** (builds the jar and tests then runs the tests, requires JUNIT setup)
45
- * ** ant examples** (builds the jar and example cases)
46
- * ** ant clean** (cleans all Java artifacts)
47
- * ** ant cleanjni** (cleans native artifacts)
48
-
49
36
wolfJSSE currently supports compilation on the following platforms:
50
37
- Linux/Unix
51
38
- Mac OSX
@@ -56,6 +43,11 @@ wolfJSSE currently supports compilation on the following platforms:
56
43
To build wolfJSSE on Windows using Visual Studio, please reference the
57
44
Windows [ README.md] ( ./IDE/WIN/README.md ) .
58
45
46
+ ## Building Native wolfSSL (Dependency)
47
+
48
+ To compile the wolfSSL JNI wrapper and JSSE provider, first the native (C)
49
+ wolfSSL library must be compiled and installed.
50
+
59
51
To build wolfJSSE in Linux/Unix environments, first download, compile, and
60
52
install wolfSSL. wolfSSL can be downloaded from the wolfSSL
61
53
[ download page] ( https://www.wolfssl.com/download/ ) or cloned from
@@ -69,7 +61,30 @@ $ make check
69
61
$ sudo make install
70
62
```
71
63
72
- Then, to build wolfJSSE:
64
+ If building a wolfSSL FIPS or FIPS Ready release bundle, additional
65
+ configure options may be required. Reference the wolfSSL Manual and build
66
+ documentation for exact build instructions.
67
+
68
+ ## Building with ant
69
+
70
+ wolfSSL JNI/JSSE's ant build is the most stable and well-tested. Newer support
71
+ for building with Maven has also been added. See section below for instructions
72
+ on building with Maven.
73
+
74
+ *** Note 1)***
75
+ The ` java.sh ` script uses a common location for the Java install location. If
76
+ your Java install location is different, this could lead to an error when
77
+ running ` java.sh ` . In this case, you should modify ` java.sh ` to match your
78
+ environment.
79
+
80
+ Build targets for ant are :
81
+ * ** ant build (ant)** (only builds the jar necessary for an app to use)
82
+ * ** ant test** (builds the jar and tests then runs the tests, requires JUNIT setup)
83
+ * ** ant examples** (builds the jar and example cases)
84
+ * ** ant clean** (cleans all Java artifacts)
85
+ * ** ant cleanjni** (cleans native artifacts)
86
+
87
+ To build wolfJSSE:
73
88
74
89
```
75
90
$ cd wolfssljni
@@ -93,6 +108,91 @@ $ ./examples/provider/ServerJSSE.sh
93
108
$ ./examples/provider/ClientJSSE.sh
94
109
```
95
110
111
+ ## Building with Maven
112
+
113
+ wolfJSSE supports building and packaging with Maven, for those projects that
114
+ are already set up to use and consume Maven packages.
115
+
116
+ wolfJSSE's Maven build configuration is defined in the included ` pom.xml ` .
117
+
118
+ First, compile the native JNI shared library (libwolfssljni.so/dylib) same
119
+ as above. This will create the native JNI shared library under the ` ./lib `
120
+ directory:
121
+
122
+ ```
123
+ $ ./java.sh
124
+ ```
125
+
126
+ Compile the Java sources, where Maven will place the compiled ` .class ` files
127
+ under the ` ./target/classes ` directory:
128
+
129
+ ```
130
+ $ mvn compile
131
+ ```
132
+
133
+ Compile and run JUnit tests using:
134
+
135
+ ```
136
+ $ mvn test
137
+ ```
138
+
139
+ Package up the wolfSSL JNI/JSSE JAR file using the following command. This will
140
+ run the JUnit tests then create a ` .jar ` file located under the ` ./target `
141
+ directory, similar to ` target/wolfssl-jsse-X.X.X-SNAPSHOT.jar ` :
142
+
143
+ ```
144
+ $ mvn package
145
+ ```
146
+
147
+ To build the Javadoc API reference for wolfSSL JNI/JSSE run the following. This
148
+ will generate Javadoc HTML under the ` ./docs/apidocs ` directory:
149
+
150
+ ```
151
+ $ mvn javadoc:javadoc
152
+ ```
153
+
154
+ To install the wolfSSL JNI/JSSE JAR file, run the following. This will install
155
+ the JAR into the local Maven repository:
156
+
157
+ ```
158
+ $ mvn install
159
+ ```
160
+
161
+ The local Maven repository installation location will be similar to:
162
+
163
+ ```
164
+ ~/.m2/repository/com/wolfssl/wolfssl-jsse/X.X.X-SNAPSHOT/wolfssl-jsse-X.X.X-SNAPSHOT.jar
165
+ ```
166
+
167
+ The wolfSSL JNI shared library (` libwolfssljni.so/dylib ` ) created with the
168
+ ` java.sh ` script will need to be "installed" by being placed on your native
169
+ library search path. For example, copied into ` /usr/local/lib ` , ` /usr/lib ` ,
170
+ or other location. Alternatively, append the ` ./libs ` directory to your native
171
+ library search path by exporting ` LD_LIBRARY_PATH ` (Linux) or
172
+ ` DYLD_LIBRARY_PATH ` (OSX):
173
+
174
+ ```
175
+ $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/wolfssljni/lib
176
+ ```
177
+
178
+ After wolfSSL JNI/JSSE has been installed into the local Maven repository,
179
+ an application can include this as a dependency in the application's
180
+ ` pom.xml ` file, similar to:
181
+
182
+ ```
183
+ <project ...>
184
+ ...
185
+ <dependencies>
186
+ <dependency>
187
+ <groupId>com.wolfssl</groupId>
188
+ <artifactId>wolfssl-jsse</artifactId>
189
+ <version>1.12.0-SNAPSHOT</version>
190
+ </dependency>
191
+ </dependencies>
192
+ ...
193
+ </project>
194
+ ```
195
+
96
196
## Examples
97
197
98
198
Examples of using wolfssljni can be found in the ` ./examples ` subdirectory.
0 commit comments