I am new to maven. I am using Maven 2.0
I am confused when packaging an Ejb application with maven.
In some sites I am seeing that in the root folder other than ejb or war there is another folder(or module) called ear.
My question why there is a ear module in the root folder whereas my root folder's goal is to make an ear ?
I'm a little confused. By "root folder" are you implying that you have parent and child POMs, and that by "root folder" you really mean "parent POM"? Perhaps describing your POMs in a little more detail (how many you have, what artifact each is building) would help.
For an EAR, you'd generally have a project with dependent projects. The root project would be the controlling one and each of the child projects would be responsible for assembling some component. Each WAR and EJB jar would be a child project, for example. An EAR child project would then be responsible for collecting them all together and creating an EAR.
The root project shouldn't need a src directory, nor should the EAR child. You only need a src directory if you have source code to compile or include into the artifact being produced. In the case of an EAR project, all the inputs would probably be dependencies. If the EAR manifest files are dynamically created, there's no need for src. Only if you're providing a static manifest or a template would you need a src directory structure to keep it in.
An IDE is no substitute for an Intelligent Developer.