Yes, idea behind new build and feature packs in 9 is extactly that.
so you could take existing feature packs and extend them with whatever you want.
take a look at https://github.com/wildfly/wildfly-build-tools and examples inside provisioning it will give you few ideas.
also see discussion on this topic: WildFly Development - Wildfly provisioning tools and packaging format | Threaded View
Keep in mind that this is still work in progress and any feedback to improve what we have now is welcome.
Either I'm doing something wrong or this isn't the abstraction I want. What I would like to do is assemble a custom WildFly out of select subsystems (actually Java EE APIs and WildFly extensions). The build would then only include the required modules.
However it's my understanding that the build currently does not work like this. When I depend on the wildfly-feature-pack I get all modules in there. If I don't want that I would have to depend on wildfly-core-feature-pack or wildfly-servlet-feature-pack, then I would have to figure out the transitive closure of all the modules that comprise the subsystems that I want to add and add them as a dependency in the POM. And finally I would have to copy module.xml for all of them.
To solve my problem there would have to be a feature pack for every subsystem.
Yes at the moment what you want is not possible.
But what you can do is to exclude stuff from feature packs when you are doing provisioning.
That would be the best thing you could do right now.
Is there some documentation on how I can exclude things or is that just a Maven exclusion on the feature pack dependency?