Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse + ANT building EAR project - best practices? Manuals?

 
Dejan Mratinkovic
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am currently using Eclipse to write code, and ANT to build and deploy to server. But, as I use single project (with one or more source folders) I am not able to use all feature available for JPA or EJB3 projects, etc, and I write most of code from scratch, using almost no tools. Works fine so far, but I guess doing it "the right way" might increase productivity.

When I try to create EAR project the way Eclipse suggested, with single Project for ear, for JPA, for EJB3..., it works fine within IDE, but it seems to be pain to get ANT script out of it. So, in that case if I wanted single ant script to build it all, it would become pretty complex.

I see some maven projects with m2eclipse, and structure seems fine and logic, but they lack the same thing - can not use advanced IDE features.

I have seen instructions how to set up EAR project with eclipse, but they eventually end up with maven. Or, I have seen couple of plug-ins for eclipse which generate ANT build scripts but non of them seemed good enough.

How do you structure your EAR projects? Do you use ANT in combination with Eclipse EAR project and what is most common/easy way of doing it? Is there a manual covering this combination?

Thanks.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do what you are currently doing - I use Eclipse as a glorified text editor and Ant or Maven for builds. I have found that many of the wizards in Eclipse that supposedly help you build your code either get in the way or make things harder. Also, I don't like surprises and I have found it much easier to correct problems when I have typed the code myself rather then attempting to figure out where Eclipse goofed.

I recall one such wizard that had me repeatedly fill in information in a form, and it then created the file in the background. The thing is that once the first entry was made, going to the source file and doing a copy+paste and editing the text would be many times simpler than re-entering in all of the data into the forms.

Any way, that is my two cents. I'm sure that not everyone will agree with my methods, but this is what works for me.
 
Dejan Mratinkovic
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Johnson wrote:I do what you are currently doing - I use Eclipse as a glorified text editor and Ant or Maven for builds.


I have started similar topic on another Java forum on my local language, and got more answers, but pretty much the same - people are ignoring eclipse way of doing stuff, and use their own, which is pretty much the same up to names of folders etc.

Is there anyone actually using what eclipse suggests?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic