- This topic has 9 replies, 3 voices, and was last updated 18 years, 10 months ago by
Riyad Kalla.
-
AuthorPosts
-
nbhatiaMemberI am evaluating MyEclipse 5.0.1 for my development environment. My current project uses Maven 2 and contains sub-projects for EJBs, JSF front-end etc. I also have .project and .classpath files for editing my Java files in Eclipse. How can I configure MyEclipse to allow editing of this project? I would like to be able to edit my JSF files through MyEclipse and also build/deploy my project on to JBoss.
P.S. So far the docs/tutorial I have seen show me how to build a MyEclipse project from scratch. I have not come across any way to “import” existing projects.
Thanks.
September 13, 2006 at 11:46 am #258503
Jeremy SteinMemberYou have to add the approriate capabilities to the project. I wrote a simple JSF/Spring project for another member of this forum. I explained how to import it into MyEclipse. You may find that helpful: http://stein.everybody.org/brain/simple-jsf-spring-example/
MyEclipse does seem to be better tested with new projects. You have to fight the “Add JSF Capabilities” feature a little bit because it tries to re-add the required web.xml changes. That would be a good feature request for MyEclipse: to provide smoother support for adding capabilities to existing projects. However, it does work — just not as smoothly as it could.
The best feature of MyEclipse (in my opinion) is the auto-hot-deployment of code changes to the web server. To take advantage of that, you have to have the output directory set to WEB-INF/classes in your source tree. (MyEclipse sets this for you when you “Add WebProject Capabilities”.) This goes against best practices with source control tools and with Maven, but in practice I’ve found it to be reasonable, as long as you didn’t have a classes directory already created. You’ll just have to be aware that there is generated output in that one directory. The beauty of this is that you then have an exploded war right in your source. MyEclipse will keep it synchronized with your web server.
September 13, 2006 at 12:42 pm #258509September 14, 2006 at 3:11 pm #258583
nbhatiaMemberJeremy,
Thanks for the pointers – very useful. I guess the only thing that is bothering me is the not so clean seperation between source and output locations – especially in the web project. Maven seems to want only source in src\main\webapp, whereas MyEclipse insists on making the WebRoot directory as a place to build the exploded war – mixing source and output. While I love the hot-deployment feature of MyEclipse, do you know of a way to keep the source and target seperate? I am even willing to create a MyEclipse project from scratch if it can coexist peacefully with Maven. Also I don’t like checking in jars into my CVS, so it would be nice if MyEclipse can pull them in from the maven local repository before doing the build out.
Thanks.
NareshSeptember 15, 2006 at 9:45 am #258603
Jeremy SteinMember@nbhatia wrote:
While I love the hot-deployment feature of MyEclipse, do you know of a way to keep the source and target seperate?
You can’t have both. But, while you’re in MyEclipse, the WEB-INF\classes directory is not shown as source. And you can always delete it when you exit.
@nbhatia wrote:
Also I don’t like checking in jars into my CVS, so it would be nice if MyEclipse can pull them in from the maven local repository before doing the build out.
You shouldn’t check in your jars. MyEclipse does pull them from the repository. This command
mvn eclipse:eclipse
puts the maven jars in your Eclipse project’s classpath. (But it also messes up the output directory, so you’ve got to fix that. See my post again for details.)
September 15, 2006 at 10:09 am #258604
nbhatiaMemberOk, I think your comments are now registering in my brain :-). I will give it a shot and let you know how it goes.
Thanks for all the help.
NareshSeptember 17, 2006 at 6:35 pm #258642
nbhatiaMemberJermey,
Your blog post was extremely helpful in importing my project into MyEclipse. Since my project is an ear, I had to fight a bit more with MyEclipse to layout the ear just like Maven is doing. I am almost there except that I am having a classloader issue with JBoss – I am getting the following error:
WARN [EJBDeployer] Verify failed; continuing
java.lang.NoClassDefFoundError: org/springframework/ejb/support/AbstractStatelessSessionBeanMy EJB uses spring. I have packaged spring-1.2.7.jar at the ear level (not in the EJB jar) and the MANIFEST.MF in the EJB jar includes spring.1.2.7 in the classpath. When Maven produces this exact layout, JBoss has no problems with it, but when MyEclipse does it, I am getting the above error. I have checked other files such as application.xml and jboss-app.xml and they are exacly the same between the two deployments. Any idea what this could be?
Thanks.
NareshSeptember 17, 2006 at 7:49 pm #258643
Jeremy SteinMemberSorry; I’ve had no experience with that. In that sort of situation, I would generally grab one copy of the Maven version and one copy of MyEclipse’s version and WinMerge them. Something has got to be different!
If you need further help, you may want to start a new thread. The MyEclipse support team seems pretty good at following up on threads without any other replies, but this one may be forgotten.
September 17, 2006 at 9:01 pm #258645
nbhatiaMemberYes, I have begun to use WinMerge and already found that a dependent jar project has nothing in it. I have started a new thread on it.
Thanks.
September 18, 2006 at 9:49 am #258670
Riyad KallaMemberNaresh,
The trick of converting an EAR to MYEclipse is to figure out all the “modules” and map those to projects in MyEclipse. With respect to your EAR/Spring library, you put it in exactly the right place, in the top level of your EAR. Did you try and regenerate the MANIFEST files to see if any of them ended up empty (Which can signify a build path issue).? -
AuthorPosts