[wildfly-dev] Adding jar to WAR from DeploymentProcessor

Stan Silvert ssilvert at redhat.com
Mon Sep 29 09:10:25 EDT 2014


On 9/29/2014 9:00 AM, Tomaž Cerar wrote:
>
> On Mon, Sep 29, 2014 at 2:32 PM, Stan Silvert <ssilvert at redhat.com 
> <mailto:ssilvert at redhat.com>> wrote:
>
>     I'd like to eliminate opening the WAR and have a DeploymentProcessor
>     look in a particular directory and add the jar at deployment time.
>     What
>     is the cleanest way to do that?
>
>
> Simple let user create new module that has that jar in it and than in 
> your war
> dependencies processor add that module to deployment as dependency
I tried that and it doesn't work very well.  The service jar will need 
to depend on classes in WEB-INF/lib.  So the dependencies get hard to 
declare in module.xml.  A user might not even know how to do it.

So it really needs to "look" like it's sitting in WEB-INF/lib.  I see 
the code in WebStructureDeploymentProcessor that adds ResourceRoots to 
Attachments.RESOURCE_ROOTS.  I'm wondering if that is the way to 
accomplish this.
https://github.com/wildfly/wildfly/blob/master/undertow/src/main/java/org/wildfly/extension/undertow/deployment/WarStructureDeploymentProcessor.java#L121
>
>     Bonus points if you tell me that I can treat the service provider
>     jar as
>     a deployment and let the user upload it via CLI. :-)
>
> you can add module as global dependency, but that is ugly.
Yea, I don't want to do that.
>
> But what you could do is have deployment processor that would handle 
> exactly
> deployments and register keycloak plugins based on that.
I don't understand what you mean by "exactly deployments".
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/wildfly-dev/attachments/20140929/3084ecde/attachment.html 


More information about the wildfly-dev mailing list