In what way does B depend on A? It should not just be a "uses" dependency unless B actually tries to make calls to A when being deployed, which is probably a bad idea.
Other dependencies can be solved either by packaging them together in an EAR or by deployment descriptor entries (possibly app.server specific ones).
[Message sent by forum member 'matterbury' (matterbury)]
http://forums.java.net/jive/thread.jspa?messageID=356574