For our use-case this would also be addressed by wildfly providing a feature-pack definition that’s somewhere between servlet-feature-pack and full-feature-pack - as long as it contains datasources support, and jaxrs support …
I think this is a good idea, to skip optional deps.
This is what wildfly-swarm does.
We consume the WF feature-packs, but only solve the tree from a few root module.xml’s to extract only the subset we need.
And if it’s optional=“true”, we pretend we don’t need it. That helps a lot.
Also, as soon as something pulls in weld, you’re pretty screwed, since weld then depends on most everything else, many times non-optionally.
-Bob