I've made a small change to jboss-classloading-vfs in my working copy so
that you can define a <maven-artifact> within a beans <classloader>
declaration, i.e.:
<classloader name="resteasy-classloader"
xmlns="urn:jboss:classloader:1.0" export-all="NON_EMPTY"
import-all="true">
<maven-artifact>org.jboss.resteasy:resteasy-jaxrs:2.0-RC1</maven-artifact>
<maven-artifact>org.jboss.resteasy:async-http-servlet-3.0:2.0-RC1</maven-artifact>
</classloader>
It has no dependency on the profile service (not sure why Scott/Julien
wanted to do it that way anyways), just a simple change to the
VFSClassLoaderPolicyModule and XML metadata classes.
I currently have it hardcoded to look in $HOME/.m2/repository for maven
artifacts, and it assumes the .jar name can be discovered from the
artifact URI.
Any interest and moving this forward at all? The idea would be to look
for artifacts in this order:
1. $JBOSS_MAVEN_REPOSITORY
2. $JBOSS_HOME/maven-repository
3. $HOME/.m2/repository
The repository would have to be on local disk. This would greatly
reduce our distribution size as there would be no copies of jars
anywhere. It would also help development as you would not have to keep
rebuilding the AS distribution, or manually copying jar files to test
individual work you are doing. It would just be a change to the
artifact declaration.
The work would be in creating a <classloader> entry in each deployment
and creating the $JBOSS_HOME/maven-repository. A maven plugin could be
written to create a beans file with classloader info in it. The only
problem I see with that is some deployment units have multiple beans.xml
files and I don't know if <classloader> is processed in all beans.xml
first before the bean metadata.
I also might need some help if there are any scoping issues as the
classloader code is a spaghetti mess.
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com