Community
Participate
Working Groups
I am not sure which component this bug belongs to: WTP Java EE Tools or Modeling M2T JET. Currently in WTP we use JETEmitter to generate the code for the Java EE artifacts: servlets, EJB beans, etc. As a side effect a .JETEmitter project is created in the workspace. Although there is a filter that hides it in the Project Explorer view, users assume that the workspace folder on the hard drive is there own property and they do not expect any system project there. We have cases where users just delete the .JETEmitter project (see bug 247854) from outside Eclipse, which makes the workspace to be out of sync and causes problems with JET code generation. It would be nice if there is a way that the .JETEmitter project is not generated next to workspace projects, but hidden in the .metadata folder. I am not sure if this change has to be done in the JET engine, or in the way it is used in WTP.
WTPJetEmitter just extends JetEmitter, which is in EMF, so this is definitely a limitation of the EMF Jet implementation. (In other words, it doesn't belong in WTP, and should probably be moved to EMF's codegen).
Moving to the JET component in Modeling. Folks, is it possible to get rid of the .JETEmitter project in the workspace?
Simple answer: Yes - stop compiling JET templates on-the-fly. Detailed answer: The .JETEmitters project is created by the JETEmitter class when it must compile a JET template 'on-the-fly'. For each template compiled, a .java file is created. The Java builder in .JETEmitters the compiles this to a .class file, which the JETEmitter class then loads and executes. On-the-fly template compilation allows templates to be overridden at runtime. It is unclear whether WTP is making use of template overriding, or is simply failing to statically compiling its templates. A builder is provided to statically compile JET templates, but I cannot find any instances of it in the WTP projects that contain JET templates. The name of the .JETEmitters project can be changed by subclasses of JETEmitter. However, the project location cannot be changed. Finally, the JET template environment used by WTP is actually part of EMF (Project: EMF, Component: Core). The M2T/JET component is an evolution of EMF's JET. It supports tag libraries and a completely different invocation paradigm. For compatibility, M2T/JET can compile EMF/Codegen templates, with some restrictions. And, it offers a mechanism for template overriding that does not rely on the on-the-fly compilation or the configuration a hidden Java projects. I'm willing to discuss how you could adopt M2T/JET. If you want to continue to use the current technology, this should be re-assigned to EMF/Core.
Paul, thank you for this detailed answer. I am willing to migrate to M2T/JET in Galileo. I appreciate your will to help. For Ganymede I will search solution with the EMF/Core/JET technology, but I will clone another bug for this. I move the bug to WTP, because there will be the actual work done.