I'm using Eclipse Galileo (3.5.1.M2) with JBoss Tools (plugin) and am building an Enterprise JEE application which consists of Entities and Session Beans in an ejb jar file and Servlets/JSPs in a War file, all wrapped up in an application EAR file to be deployed on JBoss AS 5.1.0.GA.
I can build the application using a keyboard accelerator (Ctrl+B), but when creating the Ear file, I need to right-click on the project, select Export -> EAR, and use the wizard, having to select the target Ear file, etc.
Is there any way to have the creation of the Ear file happen automatically as a part of the build process?
If not, is there any way to get the IDE to remember the Ear settings, such that I can just click a single button to generate it again - without having to go through the menus and wizard?
I've gone through the Eclipse help, but can't seem to find anything that will help me here.
Yes. You can create an Ant build.xml that does what you want. You then have one click access to run it. Or you can add that build.xml as a custom builder to your project so it happens automatically.
Ahhh, sweet. I think that is just what I was looking for. Can I assume that when I add the Ant build to my project builders, that it will get run in the order specified each time I build my project using the Project -> Build All (Ctrl+B)?
Also, since the rest of the build process is already being done, all my Ant build script needs to do is cobble together the Ear file, right?
Therefore, I could name my Ant build something like 'Build EAR File', since that's all it would be doing?
Thanks for your help. I've created an Ant build script, and got it to work for the most part from within Eclipse.
The problem is that I've discovered I can't use Ctrl+B to execute the Build All when focus is on a source file editor window.
As I edit source files, I want to be able to Save them (Ctrl+S), then build the project (Ctrl+B).
I edited the configuration for General -> Editor -> Keys to remove the key binding for "Bold" (which was set to Ctrl+B in certain contexts) and now Ctrl+B executes the build regardless of the context.
I can see how I might want Ctrl+B to execute the Bold command when editing HTML/JSP files, but not when editing Java source files. However, I guess I can live without Ctrl+B = Bold. Can you think of any reason I would not want to solve my problem in this way?