TomEE already supports to enrich an application with dependencies through ClassLoaderConfigurer configuration or using VirtualWebAppClassLoader of Tomcat. The first one has the drawback to be configured in the container and the second to not be very configurable/extensible.
That’s why we now have jars.txt!
The idea is simple: add jars.txt file to WEB-INF. The content will list dependencies. It can be file paths or urls (http, mvn by default).
Here a sample:
mvn:org.apache.deltaspike.core:deltaspike-core-api:0.3-incubating mvn:org.apache.deltaspike.core:deltaspike-core-impl:0.3-incubating
Note: if you are not using the provisining module of OpenEJB (using aether) mvn resolution will be done downloading from repo1 or a specified repo (mvn:http://myrepo.com!org.foo:bar:1.0).
Next step can be to get a maven plugin supporting or helping with the generation of such a file.