• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Can the Ear file creation be automated using Eclipse IDE?

 
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
author & internet detective
Posts: 42135
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Jeanne Boyarsky
author & internet detective
Posts: 42135
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To add a custom builder, go to project preferences > builders > new > ant builder and link it to your ant script
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
author & internet detective
Posts: 42135
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic