You dont need the datasource to be bundled with ur ear. Just drop the -service.xml in the deploy and the associated jarfile(for the driver) into the lib and that should be enough for ur ear to discover the datasource.
Thank you for answer, I just thought that bundled variant would be preferable for my customer.
The question maybe better points to creating of enterprise application because I don't know why I need application.xml in *.ear archive.
the application.xml is per the J2ee-spec to notify the app server about the components that are packed as an ear.
check the specs to find more about why an app.xml is needed.
Thank you for answers. I'm realy appreciated.