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
Go to menu File > New > Project from Existing Sources
Select your html-client-sdk directory
Select Import project from external model
Select Keep project and module files in and select the html-client-sdk directory,
Select only the sample projects.
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.
Open the Preferences dialog, go to Build > Application Servers
Click on + to add a new Spring dmServer (the old name for Virgo)
Select your html-client-sdk/vsphere-ui/server directory. Keep other settings.
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
Go to menu Run > Edit Configuration
Add a configuration of type Spring dmServer
Change the port from 8080 to 9443 and the URL to https://localhost:9443/
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:
For HTML bundles, click + in the Output Layout tab and select the .war file from the target directory of that HTML project.
For Java bundles, click + in the Output Layout tab and select the .jar file from the target directory of that Java project.
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:
Make sure that vsphere-ui/plugin-packages/ doesn't contain another copy of the sample
or plugin you're developping in IntelliJ. That directory is automatically scanned, so remove any plugin package
you don't want to deploy in your dev environment.
If you get the error Target repository folder is not configured you can work it around by creating
a dummy repository folder as shown in the picture below:
See also:
Javascript API -
Java API -
FAQ