You build the remote plug-in sample with a Maven build directed by the sample's pom.xml file.

After you download the vSphere Client SDK, you must build the remote plug-in sample before you can run it.

  1. Generate an SSL certificate and a JKS key store for the remote plug-in server using Java's keytool certificate 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"
    Note:

    Do not change the values of the arguments of keytool utility except the value mydevbox in the -dname "CN=mydevbox" argument. The value mydevbox must 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.

  2. 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" -Force

    MacOs example:

    Downloads % mv -f keystore.jks \
     ~/html-client-sdk/samples/remote-plugin-sample/src/main/resources/keystore.jks
  3. Navigate to the sample directory:

    PowerShell example:

    PS C:\> cd html-client-sdk/samples/remote-plugin-sample

    MacOS example:

    Downloads % cd ~/html-client-sdk/samples/remote-plugin-sample
  4. Install the Web Services API library into the local Maven repository:
    mvn validate
  5. Build the sample:
    mvn clean install

    For production builds, substitute mvn clean install -Dproduction.build=true in step 5.

Prerequisites

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.

Results

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.

What to do next

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.