Referencing information in pom.xml for the list of tested databases

Closes: #21349
This commit is contained in:
Alexander Schwartz 2023-07-05 17:52:02 +02:00 committed by Pedro Igor
parent a230a4588a
commit 3f1553c6cb
4 changed files with 24 additions and 14 deletions

View file

@ -15,13 +15,13 @@ This {section} explains how to configure the Keycloak server to store data in a
The server has built-in support for different databases. You can query the available databases by viewing the expected values for the `db` configuration option. The following table lists the supported databases and their tested versions. The server has built-in support for different databases. You can query the available databases by viewing the expected values for the `db` configuration option. The following table lists the supported databases and their tested versions.
|=== |===
|Database | Tested Version |Database | Option value | Tested Version
|mariadb| 10 |MariaDB Server | `mariadb` | ${properties["mariadb.version"]}
|mssql| 2016 |Microsoft SQL Server | `mssql` | ${properties["mssql.version"]?replace("-latest","")}
|mysql| 8 |MySQL | `mysql` | ${properties["mysql.version"]}
|oracle| 12c |Oracle Database | `oracle` | ${properties["oracledb.version"]}
|postgres| 15 |PostgreSQL | `postgres` | ${properties["postgresql.version"]}
|=== |===
By default, the server uses the `dev-file` database. This is the default database that the server will use to persist data and By default, the server uses the `dev-file` database. This is the default database that the server will use to persist data and
@ -131,16 +131,18 @@ Unicode is supported for a PostgreSQL database when the database character set i
. Check the default character set for a PostgreSQL cluster by entering the following SQL command. . Check the default character set for a PostgreSQL cluster by entering the following SQL command.
+ +
``` [source]
----
show server_encoding; show server_encoding;
``` ----
. If the default character set is not UTF 8, create the database with the UTF8 as the default character set using a command such as: . If the default character set is not UTF 8, create the database with the UTF8 as the default character set using a command such as:
+ +
``` [source]
----
create database keycloak with encoding 'UTF8'; create database keycloak with encoding 'UTF8';
``` ----
== Changing database locking timeout in a cluster configuration == Changing database locking timeout in a cluster configuration

View file

@ -2,6 +2,7 @@ package org.keycloak.guides.maven;
import freemarker.template.TemplateException; import freemarker.template.TemplateException;
import org.apache.maven.plugin.logging.Log; import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
import org.keycloak.common.Version; import org.keycloak.common.Version;
import java.io.File; import java.io.File;
@ -16,7 +17,7 @@ public class GuideBuilder {
private final File targetDir; private final File targetDir;
private final Log log; private final Log log;
public GuideBuilder(File srcDir, File targetDir, Log log) throws IOException { public GuideBuilder(File srcDir, File targetDir, Log log, MavenProject project) throws IOException {
this.srcDir = srcDir; this.srcDir = srcDir;
this.targetDir = targetDir; this.targetDir = targetDir;
this.log = log; this.log = log;
@ -24,13 +25,16 @@ public class GuideBuilder {
Map<String, Object> globalAttributes = new HashMap<>(); Map<String, Object> globalAttributes = new HashMap<>();
globalAttributes.put("ctx", new Context(srcDir)); globalAttributes.put("ctx", new Context(srcDir));
globalAttributes.put("version", Version.VERSION); globalAttributes.put("version", Version.VERSION);
globalAttributes.put("properties", project.getProperties());
this.freeMarker = new FreeMarker(srcDir.getParentFile(), globalAttributes); this.freeMarker = new FreeMarker(srcDir.getParentFile(), globalAttributes);
} }
public void build() throws TemplateException, IOException { public void build() throws TemplateException, IOException {
if (!srcDir.isDirectory()) { if (!srcDir.isDirectory()) {
srcDir.mkdir(); if (!srcDir.mkdir()) {
throw new RuntimeException("Can't create folder " + srcDir);
}
} }
for (String t : srcDir.list((dir, name) -> name.endsWith(".adoc"))) { for (String t : srcDir.list((dir, name) -> name.endsWith(".adoc"))) {

View file

@ -6,6 +6,7 @@ import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.FileUtils;
import java.io.File; import java.io.File;
@ -19,6 +20,9 @@ public class GuideMojo extends AbstractMojo {
@Parameter(property = "project.build.directory") @Parameter(property = "project.build.directory")
private String targetDir; private String targetDir;
@Parameter(defaultValue = "${project}", readonly = true, required = true)
private MavenProject project;
@Override @Override
public void execute() throws MojoFailureException { public void execute() throws MojoFailureException {
try { try {
@ -42,7 +46,7 @@ public class GuideMojo extends AbstractMojo {
log.info("Guide dir: " + srcDir.getAbsolutePath()); log.info("Guide dir: " + srcDir.getAbsolutePath());
log.info("Target dir: " + targetDir.getAbsolutePath()); log.info("Target dir: " + targetDir.getAbsolutePath());
GuideBuilder g = new GuideBuilder(srcDir, targetDir, log); GuideBuilder g = new GuideBuilder(srcDir, targetDir, log, project);
g.build(); g.build();
} }
} }

View file

@ -157,7 +157,7 @@
<twitter4j.version>4.1.2</twitter4j.version> <twitter4j.version>4.1.2</twitter4j.version>
<jna.version>4.5.1</jna.version> <jna.version>4.5.1</jna.version>
<!-- Databases --> <!-- Databases - also published to db.adoc as "Tested Version" -->
<mysql.version>8.0</mysql.version> <mysql.version>8.0</mysql.version>
<mysql-jdbc.version>8.0.30</mysql-jdbc.version> <mysql-jdbc.version>8.0.30</mysql-jdbc.version>
<postgresql.version>15</postgresql.version> <postgresql.version>15</postgresql.version>