Bug 52267 - Nested service element in WAR task puts service descriptor files in the wrong place in the .WAR.
Summary: Nested service element in WAR task puts service descriptor files in the wrong...
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.8.2
Hardware: PC Windows Vista
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-30 22:46 UTC by Esmond Pitt
Modified: 2012-08-13 04:49 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Esmond Pitt 2011-11-30 22:46:29 UTC
Service descriptor files are loaded as class resources by java.util.ServiceLoader. Therefore they have to be in the classpath. If you specify <jar ...><service .../></jar> this works correctly: the service descriptor files are JAR'd as /META-INF/services/*. However in a WAR file this is not correct. At present if you specify <war ...><service/></war> the same happens as above. The correct location in a WAR file is /WEB-INF/classes/META-INF/services/*.
Comment 1 Stefan Bodewig 2011-12-02 16:12:00 UTC
You are correct but then again you are not correct to expect anything else based on the documentation 8-)

Some of the inherited pieces implemented by <jar> don't make much sense
in the context of <war> or <ear>.  The <services> element could, but currently
doesn't.

Using WEB-INF/classes in the case of <war> sounds good to me.