@Eduardo, thank you very much for your reply.
I said "import" because the scope of the BOM was import. I could have explained that better.
One thing I forgot to explain in my original post was how all of the configurations was thought to be in the <dependencyManagement> in the root pom.xml. So whatever sub-module wanting to use for example org.apache.httpcomponents:httpmime would also have to add org.apache.httpcomponents:httpclient:provided as a dependency to their module.
I will look more into jboss-deployment-structure.xml, I'm really not a fan of configuration added to META-INF/WEB-INF(beans.xml is bad enough). But if it is simply a better way of doing it than adding global-modules to the standalone, I might swap over.
My go to way of cleaning up dependencies so far has been to:
- Build the EAR artifact
- Look into the lib folder of the EAR artifact
- Check if there is any dependency (.jar) there which is also provided by Wildfly.
- Do mvn dependency:tree to find where this dependency is located.
- Either change the dependency from compile to provided, or if a child-dependency, exclude it, and add it with scope=provided in the same POM.
Does this sound reasonable? The hardest part of this routine is when the dependency needs to be added to jboss-deployment-structure.xml or global-modules, because it is private such as org.apache.httpcomponents.
I'm not sure I fully understand what you mean by: "Please note that the usage of Wildfly BOM’s one is done automatically by Maven, which only uses one version per artifact... the first one it found in Dependency Management or, if no version found in Dependency Management, the first one it found in Dependencies." I will setup a test project building an EAR and testing a few different scenarios.