Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"Eclipse + EJB3 + Maven" question

 
Denis Zjukow
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Denis,
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.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Denis Zjukow
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic