Currently the WAR task puts the compiled java classes under WEB-INF/classes. Instead I would like them to get bundled into a JAR and placed in WEB-INF/lib.
This would be analogous to Maven’s archiveClasses=true setting:
You are correct. It’s not a built-in feature of the WAR plugin. What’s the benefit of doing that from your perspective? If the main purpose is to reuse the classes as bundled JAR file somewhere else, it’s really easy to write your own task of type ‘Jar’ to achieve that.
One use case I’ve seen is allowing the ability to easily override classpath resources in the jar by putting them in WEB-INF/classes. Typically this is the case when the war you are building is primarily going to be used as an underlay.