SPI JAR Deployment and jboss-deployment-structure.xml

When I deploy my jar, my SPIs within it, do not get added. I can’t find them on the Server Info page on Keycloak’s dashboard, or anywhere else.

Except, I do see my jar added to the themeResources section of Server Info.

image

Due to this, I assumed there’s an issue with the Java SPIs I try to deploy within the same jar or the META-INF. The services in META-INF are all defined, so I suspect my jboss-deployment-structure.xml isn’t correct. I have bunch of maven dependencies that I use in my SPIs but I didn’t define those in the JBoss XML file.

Should all dependencies be defined there, or I should just keep the org.keycloak and org.jboss?

My jboss-deployment-structure.xml looks like this

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module name="org.keycloak.keycloak-core"/>
            <module name="org.keycloak.keycloak-server-spi"/>
            <module name="org.keycloak.keycloak-server-spi-private"/>
            <module name="org.keycloak.keycloak-services"/>
            <module name="org.keycloak.keycloak-saml-core-public"/>
            <module name="org.jboss.logging"/>
        </dependencies>
    </deployment>
</jboss-deployment-structure>

Hi

same here,
any update ?

Yeah, setting all the keycloak dependencies as provided (scope) was missing for me

All dependencies ie modules defined in the jboss-deployment-structure.xml have to be defined as provided in maven’s pom.xml