Add Dependency section for creating an SPI

Closes #36798

Signed-off-by: AndyMunro <amunro@redhat.com>
Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
Co-authored-by: Alexander Schwartz <aschwart@redhat.com>
(cherry picked from commit 1912602a5a98896ba475a27da29119768786248e)
This commit is contained in:
andymunro 2025-01-28 03:36:43 -05:00 committed by GitHub
parent 332c12bcea
commit 645f75470b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -122,6 +122,44 @@ public class MyThemeSelectorProvider implements ThemeSelectorProvider {
}
----
The pom.xml file for your SPI requires a `dependencyManagement` section with an import reference to the {project_name} version that is intended for the SPI. In this example, replace the occurrence of `VERSION` with {project_versionMvn}, which is the current version of {project_name}.
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>test-lib</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-parent</artifactId>
<version>VERSION</version> <!--1-->
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-model-jpa</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
----
<.> Replace `VERSION` with the current version of {project_name}
[[_override_builtin_providers]]
==== Override built-in providers