Sharing Code Generation Customizations

This tutorial walks you through sharing Spring code generation customizations. Sharing customizations is beneficial for setting coding standards across developers and projects and for allowing the expansion of features through a community of developers. In this tutorial, you will learn how to:

  • Create a customization project
  • Package the project for sharing
  • Use the packaged customization in another project

Customizing Spring code generation requires a MyEclipse Spring or Bling subscription.

1. Create a Customization Project

A Customization project is for customizing a full set of code generation templates. The Customization project is a standard Eclipse project that contains all available JET templates.

  1. Select File>New>Other, expand MyEclipse Customization, and select MyEclipse for Spring Customization Project. Click Next.

    Creating a new Customization project
  2. Type AcmeCustomizations as the project name, and click Finish.

    Naming the project

2. Package the Customization Project

After creating customizations in the Customization project, export the project into a JAR to share it.

  1. Right-click AcmeCustomizations, and choose Export.
  2. Expand Java, and select JAR File. Click Next.

    Exporting a JAR
  3. Select the export destination, give the JAR a name, and click Next until you get to the JAR Manifest Specification page (4th page).
  4. Select the Use existing manifest from workspace option, choose the /AcmeCustomizations/META-INF/MANIFEST.MF file by using the Browse button, and click Finish.

    Selecting the manifest

3. Use the Customization Jar in Another Project

Now that a new customization project has been packaged, you can use that JAR in another project. Feel free to use another  instance of MyEclipse with Spring support, or pass this JAR onto another developer  as you go through the following steps.

  1. Create a new folder called customization in a new project, and copy and paste the acmecustomizations.jar into the new folder.

    Pasting the .jar into the workspace
  2. Associate the customization JAR with the project (or workspace) by opening the Project (or Workspace) Preferences, expanding MyEclipse>Customization, and adding the JAR as shown below.

    Associating the customization .jar
  3. Click OK all the way through, and then you are ready to scaffold with the customizations.