File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark ""Eclipse + EJB3 + Maven" question" Watch ""Eclipse + EJB3 + Maven" question" New topic

"Eclipse + EJB3 + Maven" question

Denis Zjukow
Ranch Hand

Joined: Mar 15, 2006
Posts: 39

I am trying to find a way how to use the following three things together:

1) Eclipse - I want to use Eclipse WTP for development;
2) EJB 3 - I need EJB 3 in my project;
3) Manven 2 - I want to use Maven 2 as a build tool.

My question: is it possible to adjust an EJB project in Eclipse so that it would use maven layout and the project was a "real" EJB project (in Eclipse sense). The last requirement is important because I find hot replace very useful (I don't want to build my application manually every time I change it).

I want to have three projects in my Eclipse workspace: WAR, EJB and EAR. I use "mvn eclipse:eclipse" tool to generate metadata for WAR and EAR. It seems to work fine. However, this approach doesn't work for EJB.

If you know the solution, please, describe it or provide a link.

Thank you!
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

Are you using an Eclipse plugin? As far as I know Eclipse doesn't have an "EJB project" type out of the box.

I think this is more of an Eclipse question than an EJB question so I'll move it to our IDES forum for you.

Note that you may get more answers if you could provide the directory structure Maven requires for EJB 3 (or a link to it.) Right now your question requires EJB 3, Maven and Eclipse experience. Providing that one link would get it down to just needing Eclipse knowledge - which is a lot more common than the combination of all three.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3753

Originally posted by Jeanne Boyarsky:
DAs far as I know Eclipse doesn't have an "EJB project" type out of the box.

If you download the "Eclispe for Java EE developers" there is support for EJBs, although the GUI is limited. I've heard MyEclipse is better for fully automated EJB development.

[OCA 8 Book] [Blog]
Denis Zjukow
Ranch Hand

Joined: Mar 15, 2006
Posts: 39
I use Eclipse Europa and it does have support for EJB projects. However, by default it uses the following structure:

This structure is different from the default maven layout which looks like this:

The question is, how to setup Eclipse project properties so that Eclipse would understand maven layout. For a WAR project I use "mvn eclipse:eclipse -Dwtpversion=1.5" and it works fine, Eclipse perfectly understands maven layout. But, unfortunately, this does not work for an EJB project.

Any ideas?
I agree. Here's the link:
subject: "Eclipse + EJB3 + Maven" question
jQuery in Action, 3rd edition