This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes When using Maven, why do I need ejb-jar.xml, web.xml and application.xml? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "When using Maven, why do I need ejb-jar.xml, web.xml and application.xml?" Watch "When using Maven, why do I need ejb-jar.xml, web.xml and application.xml?" New topic
Author

When using Maven, why do I need ejb-jar.xml, web.xml and application.xml?

Iarla O'Riada
Ranch Hand

Joined: Oct 06, 2012
Posts: 78

From what I'm reading, these deployment descriptors define where classes and dependencies go. Maven manages dependencies too though. Does Maven have scope at this level? It doesn't make sense to me that it's not enough to just define your packages at the top of each class and then let Maven do the rest.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Those descriptors are used at runtime by the container, and Maven is not running at that time (Maven runs at build time). That is why there are needed (though in more recent versions of Java EE they are optional - the container can easily learn the necessary information by scanning the classes).


JBoss In Action
Iarla O'Riada
Ranch Hand

Joined: Oct 06, 2012
Posts: 78

Thanks Peter Johnson, that helps a lot.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: When using Maven, why do I need ejb-jar.xml, web.xml and application.xml?