VMware vSphere HTML Client SDK

IntelliJ IDEA Setup

IntelliJ IDEA installation

Download JetBrain's IntelliJ IDEA Ultimate, the version for web and enterprise development. It comes with a free 30-day trial.

After installing IntelliJ you should install the following plugins (in Preferences > Plugins):
- Eclipse integration, so that IntelliJ can recognize the samples' Eclipse projects.

Creating a project with SDK samples

  1. Go to menu File > New > Project from Existing Sources
  2. Select your html-client-sdk directory
  3. Select Import project from external model

  4. Select Keep project and module files in and select the html-client-sdk directory,

  5. Select only the sample projects.
  6. In the next screen select Java 1.7 or 1.8 depending on the JDK you installed.

Then you should see the samples as separate modules in the left Project view.

Warnings may appear because IntelliJ didn't interpret all the sample files. If you see the message Frameworks detected: OSGi, Web, Spring frameworks are detected in the project, it is OK to click Configure.

Adding the Virgo server

IntelliJ allows to start Virgo within the IDE, the same way Eclipse does.

  1. Open the Preferences dialog, go to Build > Application Servers
  2. Click on + to add a new Spring dmServer (the old name for Virgo)
  3. Select your html-client-sdk/vsphere-ui/server directory. Keep other settings.

  4. Name this Spring dmServer instance using the current SDK version to distinguish it from other instances you may add with future versions.

Virgo run configuration

  1. Go to menu Run > Edit Configuration
  2. Add a configuration of type Spring dmServer
  3. Change the port from 8080 to 9443 and the URL to https://localhost:9443/

  4. Artifacts can be added in the Deployment tab. Click + and select the dm Bundle artifacts created for the samples or other plugin projects you want to deploy.
    Note that for each plugin the service (java) bundle(s) must be listed before the UI (html) bundle(s) because of dependencies.

Building the samples

You can build the samples in the Terminal window using the build-war.[sh,bat] and build-java.[sh,bat] scripts. This requires to have set the env variable VSPHERE_SDK_HOME to your /html-client-sdk directory as described in the SDK setup instructions.

Or you can use IntelliJ's Ant Build view. Drag each build-war.xml and build-java.xml file to that Ant Build view and use the toolbar to run the builds. Use the + button and select the file build-all.xml to add it to the Ant Build view.

Note that when starting an Ant script from IntelliJ instead of a Terminal window you need to add property VSPHERE_SDK_HOME to that Ant script using the Properties button next to the ? button.

Select build-all to build all samples at once.

dm Bundle artifacts configuration

After building the samples, or your own plugin, a dm Bundle artifact must be created for each of them in order to be able to deploy them with a Virgo run within IntelliJ.

Open the Project preferences, select Artifacts on the left, under Project Settings, click + and select dm Bundle for the artifact type":

Create a dm Bundle for each html and service project, using the project name for artifact name:



Starting Virgo with the desired artifacts

Once artifacts are created for SDK samples or your own plugin, see the section on Virgo run configuration above to add these artifacts to a Virgo run configuration.

Before you start Virgo in IntelliJ with your selected artifacts check the following things:

See also: Javascript API - Java API - FAQ