Building the sample plug-ins and pattern types in Eclipse

Learn how to build the sample plug-ins and pattern types in Eclipse.

About this task

These steps show you how to build the sample plug-ins and pattern types in Eclipse. For more information about building your own plug-ins and pattern types in Eclipse, see the Related tasks section.

Procedure

Building the plugin.depends project

  1. Import the PDK plugin.depends project and the sample source projects.
    1. Create a workspace and start Eclipse.
    2. Click File > Import > General > Existing Projects into Workspace. Select Select root directory. Click Browse to select the iwd-pdk-workspace directory where you downloaded and expanded the pdk-<version>.zip file.
    3. Select plugin.depends, and the sample projects if you want to build them.
      When the import is complete, the projects are added to your workspace.
  2. Build all plug-ins in the workspace. Go to the plugin.depends project and run the build.xml Ant script. To run the Ant script, right-click the file and select Run As > Ant Build.

Building the Hello sample plug-ins and pattern type

  1. Build the hello pattern type. Go to the patterntype.hello project and run the build.patterntype.xml script. To run the Ant script, right-click the file and select Run As > Ant Build.
  2. Refresh the patterntype.hello project. A folder named export is displayed. Go to the export folder. The .tgz pattern type file is located here. It is ready for installation into the catalog.

Building the WebSphere Application Server Community Edition sample plug-ins and pattern type

To use the WAS CE sample, you must first download the WebSphere Application Server Community Edition binary file. Then, you can build the WAS CE plug-ins (from plugin.depends) and the WAS CE pattern type as shown in the following steps, which demonstrate how to use the -Dstorage.dir command to package the WebSphere Application Server Community Edition binary file with the sample.

  1. Create a storage directory. In the following steps, this storage directory is referred to as <storage_dir>.
  2. Download the binary file for the WebSphere Application Server Community Edition (WAS CE) server to <storage_dir>/wasce so that you can add it to the pattern type:
    1. Go to the download page for WebSphere Application Server Community Edition on DeveloperWorks: WebSphere Application Server Community Edition.
    2. Click Download.
    3. Log in using your DeveloperWorks user account.
    4. Download the Server for UNIX to <storage_dir>/wasce. The file name is wasce_setup-3.0.0.x-unix.bin.
      Note: The file name varies depending on the current version.
  3. Update config.json with the file name for the WebSphere Application Server Community Edition version that you downloaded in Step 6.
    1. Expand the plugin.com.ibm.wasce-advanced project on the Project Explorer tab in Eclipse.
    2. Expand the plugin folder in the plugin.com.ibm.wasce-advanced project.
      Note: The name of this directory varies depending on the version of the sample that you are using.
    3. Double-click config.json to open it in the Config Json Editor. Alternately, you can right-click the file and select Open With > PDK Json Editor.
    4. Select the config.json tab in the editor.
    5. Change the file name that is referenced in config.json to the name of the file that you downloaded in Step 6. You must change the file name in two places:
      "files": [
            "wasce\/wasce_setup-3.0.0.2-unix.bin"
         ],
      and
      "parts": [
                     {
                        "part": "parts\/wasce.tgz",
                        "parms": {
                           "binaryFile": "wasce\/wasce_setup-3.0.0.2-unix.bin"
                        }
                     }
                  ]
               }
            ],
    6. Save your changes.
    7. Run the build.plugin.xml Ant script in the plugin.com.ibm.wasce-advanced project to rebuild the plug-ins for the WAS CE sample. To run the Ant script, right-click the file and select Run As > Ant Build.
  4. Build the WAS CE pattern type by using one of these methods:
    • Go to the patterntype.wasce.ptype project and run the build.patterntype.xml script by using the -Dstorage.dir argument. To run the Ant script, right-click the file and select Run As > Ant Build. Go to the Main tab, and add -Dstorage.dir=<storage_dir> to the arguments section. Click Run. This command builds the pattern type and copies the WebSphere Application Server Community Edition binary file into the pattern type.
      Note: If your files are on a remote site, use the -Dstorage.url parameter.

      For example, ant -f build.patterntype.xml -Dstorage.url=<remote server URL>.

    • Right-click the patterntype.wasce.ptype project and select Build with binary. Enter the folder that contains the installation files when you are prompted.
  5. Refresh the patterntype.wasce.ptype project. A folder named export is displayed. Go to the export folder. The .tgz pattern type file is located here. It is ready for installation into the catalog.

    If you want to change the plug-in or pattern type, you can install a new version of it without using the -Dstorage.dir=storage_dir parameter during your build or including the WebSphere Application Server Community Edition binary file because you use the same WebSphere Application Server Community Edition binary file that is already in the Storehouse. Using this method allows for faster import time for your enhancements. For more information about the -Dstorage.dir and -Dstorage.url parameters, see the Related information section.

Results

The environment is set up and the sample pattern type and plug-ins are built.

What to do next

If you want to explore plug-in development with the sample pattern type, see the Related reference section.