Do you need to deploy your DataSource along with your Enterprise Application ? (that is without having to install it in the "deploy" dir )
So, In your EAR file, create a jboss-app.xml file containing the following:
Place this jboss-app.xml in the META-INF folder of your EAR. And place the -ds.xml at the root of the EAR.
JBoss AS 7 users
JBoss AS 7.1.1 supports deploying datasources along with your applications well: check this article to learn more about it.