2 Replies Latest reply on Nov 20, 2012 7:03 AM by Tomaz Cerar

    How create a new deployer?

    ulrichromahn Newbie

      Hi All,

       

      I would like to create a new deployer for the following use case:

       

      I would like to create a file, preferably an XML file, which contains a "bundle name" (not to confuse with OSGi bundles, though), and a list of JAR's, WAR's, or EAR's that should be deployed.

      All those artifacts to be deployed should be specified by a URI, e.g. "file:/home/myname/deployments/my-new-app-1.0.0.jar" or "mvn:org.mydomain.app/myapp/1.0.0/war".

       

      The file should then be picked up by my new deployer and then the list of all those artifacts should be resolved (found) according to the URI.

      From the example above, the first URI should find the "my-new-app-1.0.0.jar" on the local filesystem under "/home/myname/deployments" and then deploy it to JBoss AS 7. The second example then demonstrates the power of this new deployer: it would try to find a WAR with the filename "myapp-1.0.0.war from a Maven repository using the groupId of "org.mydomain.app" and artifactId of "myapp". My specific implementation would be configurable to look into a local ".m2" repository first and if not found, try to download it from a remote Maven repository. The URL to this repository should be configurable. This could be implemented similar to the OSGi Repository implemented as part of JBOSGI.

       

      The idea to this deployer comes from the Apache Karaf Features functionality which is very powerful since it enables deployments directly from a Maven repository and I would like to extend to a non-OSGi use case with JBoss AS 7

       

      Here is my question:

       

      Are there any HOWTO's, examples, or other documentation that describes how to implement a new deployer in JBoss AS7? It would even be helpful if someone could point me to some existing implementations?

      I looked at the current source and tried to figure out how the deployer for the "*-ds.xml" files was implemented, but it is hard for me to see how this would be hooked into the overall JBoss deployment subsystem?

       

      Any help or pointers would be much appreciated.