I've started playing with a 'Proxy' Container that can dynamically load the target container for any given JBoss AS / JBoss EAP / WildFly container adapter.
The original goal was;
- Simplify the configuration for JBoss/WildFly containers as they have 10+ different container adapters depending on which server (AS/EAP/WildFly) and which version and type.
The result is a 'proxy' container that based on configuration of Target Server can dynamically load the correct adapter.
<container qualifier="name" default="true">
The target property has the format of server:version:type.
Internally it decides based on the target which adapter coordinates and adapter version to use, e.g.;
jboss eap:6.3:remote -> org.jboss.as:jboss-as-arquillian-container-remote:7.2.0.Final
jboss eap:6.0:remote -> org.jboss.as:jboss-as-arquillian-container-remote:7.1.2.Final
jboss as:7.1.1.Final:remote -> org.jboss.as:jboss-as-arquillian-container-remote:7.1.1.Final
wildfly:8.1.0.Final:remote -> org.wildfly:wildfly-arquillian-container-remote:8.1.0.Final
wildfly:9.0.0.Alpha1:managed -> org.wildfly.arquillian:wildfly-arquillian-container--managed:9.0.0.Alpha1
(The crude logic can be found here: https://github.com/aslakknutsen/arquillian-container-proxy/blob/master/src/main/java/org/arquillian/container/proxy/spi/Profile.java#L60)
A few of the interesting side effect of the dynamic artifact resolution are:
- No more Server client dependencies on application classpath
- Ability to configure multiple Maven Surefire Executions in the same profile and target multiple different Target servers
- Ability to configure a group in Arquillian configuration and target multiple different 'JBoss' runtimes without the use of the Droidium multi container extension.
Some downside of the current impl is:
- The normal Arquillian extension model is by-passed for the dynamically loaded adapter, meaning nothing besides the 'DeployableContainer' work.
- How to configure the ShrinkWrap Resolver instance?
The source can be found here: https://github.com/aslakknutsen/arquillian-container-proxy