Follow these best practices when you set up your WebSphere Dashboard Framework project for deployment.
For additional information, see the WebSphere Portlet Factory Deployment page.
Add a Portlet Adapter builder to your model.
The Portlet Adapter builder tells Portlet Factory to add your model to the WAR file. If your model does not have a Portlet Adapter builder in it, it will not be contained in your WAR file.
Change deployment properties for the project.
After you have created your project, and can always go back and modify your project properties. For example, you might decide that auto-deploy of the portlet WAR file is too slow, and you want to disable this feature. Or, you might want to change the location or name of your portlet WAR file. All of this is easily accomplished by modifying your project properties. To change deployment properties, right-click the project and select Properties
. Click WebSphere Portlet Factory
> Deployment Info
, then open the configuration that contains the settings you want to change.
Exclude unnecessary files from being built into the WAR file.
Suppose you have several samples, test models, images, and HTML files that you used during development, but are not required for your production portlets to work. In order to reduce the size of your WAR file, you can exclude these files from being deployed. There are two ways to do this:
- Create a directory called **/nodeploy/**. Artifacts placed within this directory are not included in a deployed WAR file. Note that you can create one or more /nodeploy/ directories at any location within a project. You can then place within these directories all of the project artifacts that you do not want included in the deployed WAR. When the WAR is built by the Ant scripts, the contents of the /nodeploy/ directories will be excluded from the build process.
- Use the .excludeFromServer file. Artifacts listed in this file are not included in a deployed WAR file. There are two versions of this file:
- One is a master version located in your feature set directory - C:\Program Files\install-dir\FeatureSets\Web-App_X.XX.X\Tools\antScripts\public\. If you want to always exclude the same files from every project you create, then you should modify this master excludeFromServer file.
- The other version of this file is located at the root of every project you create. Since the most common scenario is to exclude artifacts on a project-by-project basis, you will tend to want to utilize the project-level excludeFromServer file.
Switch the project to deployment mode for better performance in a production environment.
The override.properties file, located in the deployed_project_name
/WEB-INF/config folder, overrides any default settings found in the bowstreet.properties file.
Add the following line to the override.properties file to change to deployment mode for a project.