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.
- Select File>New>Other, expand MyEclipse Customization, and select MyEclipse for Spring Customization Project. Click Next.
- Type AcmeCustomizations as the project name, and click Finish.
2. Package the Customization Project
After creating customizations in the Customization project, export the project into a JAR to share it.
- Right-click AcmeCustomizations, and choose Export.
- Expand Java, and select JAR File. Click Next.
- Select the export destination, give the JAR a name, and click Next until you get to the JAR Manifest Specification page (4th page).
- Select the Use existing manifest from workspace option, choose the /AcmeCustomizations/META-INF/MANIFEST.MF file by using the Browse button, and click Finish.
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.
- 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 - 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.
- Click OK all the way through, and then you are ready to scaffold with the customizations.