Build the vSphere
Client Remote Plug-in Sample
You build the remote plug-in sample
with a Maven build directed by the sample's
pom.xml
file. Before building the remote plug-in sample, you must
have the following:
- You need Java 8 to compile the code for this sample.
- You need Maven 3 to build the plug-in package.
- Download the SDK and unzip it. See Remote Plug-in Sample Directory Structure for information about the structure of the SDK archive.
After you download the vSphere Client SDK,
you must build the remote plug-in sample before you can run it.
- Generate an SSL certificate and a JKS key store for the remote plug-in server using Java'skeytoolcertificate management utility:PowerShell example:PS C:\> keytool -genkeypair -alias plugin-server -keyalg RSA -keysize 4096 ` -storetype JKS -keystore keystore.jks -storepass "remote.plugin" -keypass "remote.plugin" ` -dname "CN=mydevbox"MacOS example:Downloads % keytool -genkeypair -alias plugin-server -keyalg RSA -keysize 4096 \ -storetype JKS -keystore keystore.jks -storepass "remote.plugin" -keypass "remote.plugin" \ -dname "CN=mydevbox"Do not change the values of the arguments ofkeytoolutility except the valuemydevboxin the-dname"CN=mydevbox" argument. The valuemydevboxmust be replaced with the IP address or the DNS name of the machine on which the remote plug-in server will run. The value is significant because vCenter Server will check whether the Common Name (CN) field value of the remote plug-in server certificate matches the host through which remote plug-in resources are served.
- Replace the default key store in the Remote Plug-in Sample code with the newly generated one.PowerShell example:PS C:\> Move-Item -Path "keystore.jks" -Destination \ "html-client-sdk\samples\remote-plugin-sample\src\main\resources\keystore.jks" -ForceMacOs example:Downloads % mv -f keystore.jks \ ~/html-client-sdk/samples/remote-plugin-sample/src/main/resources/keystore.jks
- Navigate to the sample directory:PowerShell example:PS C:\> cd html-client-sdk/samples/remote-plugin-sampleMacOS example:Downloads % cd ~/html-client-sdk/samples/remote-plugin-sample
- Install the Web Services API library into the local Maven repository:mvn validate
- Build the sample:mvn clean installFor production builds, substitutemvncleaninstall-Dproduction.build=truein step 5.
These steps install the Web
Services API library into the local Maven repository, download and build the
sample executable, download the Clarity design system, and build the JAR file
that contains the sample components. The sample is a Spring Boot Application
that will start an embedded Tomcat server when you run the sample in a command
shell.
Choose a production build for the client code to
run more efficiently. Choose a development build for a better debugging
experience.
After you build the remote plug-in sample, you need to
locate authentication information, start the plug-in server, and register the
plug-in with
vCenter
Server
.