[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » IDEs, Version Control and other tools
 
RSS feed
 
New topic
Author

Can the Ear file creation be automated using Eclipse IDE?

Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Messages: 516

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.

Thanks,
Jeanne Boyarsky
internet detective
Sheriff

Joined: May 26, 2003
Messages: 17177

Mark,
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.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]

"The set strikes me as something like the set of potatoes, radishes, farming, and lunch. " - a colleague's way of comparing both overlapping and disparate groups. made me laugh and thought of the ranch
Jeanne Boyarsky
internet detective
Sheriff

Joined: May 26, 2003
Messages: 17177

To add a custom builder, go to project preferences > builders > new > ant builder and link it to your ant script

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]

"The set strikes me as something like the set of potatoes, radishes, farming, and lunch. " - a colleague's way of comparing both overlapping and disparate groups. made me laugh and thought of the ranch
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Messages: 516

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?

Or am I thinking about this in the wrong way?

Thanks,
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Messages: 516

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?

Thanks,
Jeanne Boyarsky
internet detective
Sheriff

Joined: May 26, 2003
Messages: 17177

Mark E Hansen wrote: Can you think of any reason I would not want to solve my problem in this way?

No. It sounds good. How often do we make things bold when writing code?

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]

"The set strikes me as something like the set of potatoes, radishes, farming, and lunch. " - a colleague's way of comparing both overlapping and disparate groups. made me laugh and thought of the ranch
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » IDEs, Version Control and other tools
 
RSS feed
 
New topic
JProfiler
Get rid of your performance problems and memory leaks!