Migrate to kokuwa parent
This commit is contained in:
parent
29b573f2f7
commit
a3784fe1f5
12 changed files with 193 additions and 414 deletions
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -1,4 +1,2 @@
|
||||||
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
|
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
|
||||||
* @sschnabe @rpahli @fabian-schlegel @jschwarze @wistefan @monotek
|
* @sschnabe @rpahli @fabian-schlegel @jschwarze @wistefan @monotek
|
||||||
.github/workflows/* @kokuwaio-bot
|
|
||||||
pom.xml @kokuwaio-bot
|
|
||||||
|
|
16
.github/dependabot.yml
vendored
16
.github/dependabot.yml
vendored
|
@ -2,21 +2,13 @@ version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: maven
|
- package-ecosystem: maven
|
||||||
directory: /
|
directory: /
|
||||||
open-pull-requests-limit: 20
|
|
||||||
schedule:
|
schedule:
|
||||||
interval: monthly
|
interval: daily
|
||||||
day: monday
|
allow:
|
||||||
# github parses time without quotes to int
|
- dependency-name: io.kokuwa.maven:maven-parent
|
||||||
# yamllint disable-line rule:quoted-strings
|
- dependency-name: org.keycloak:keycloak-quarkus-server
|
||||||
time: "09:00"
|
|
||||||
timezone: Europe/Berlin
|
|
||||||
- package-ecosystem: github-actions
|
- package-ecosystem: github-actions
|
||||||
directory: /
|
directory: /
|
||||||
open-pull-requests-limit: 10
|
|
||||||
schedule:
|
schedule:
|
||||||
interval: monthly
|
interval: monthly
|
||||||
day: monday
|
day: monday
|
||||||
# github parses time without quotes to int
|
|
||||||
# yamllint disable-line rule:quoted-strings
|
|
||||||
time: "09:00"
|
|
||||||
timezone: Europe/Berlin
|
|
||||||
|
|
16
.github/settings.xml
vendored
Normal file
16
.github/settings.xml
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- https://github.com/actions/setup-java/issues/85 -->
|
||||||
|
<settings>
|
||||||
|
<servers>
|
||||||
|
<server>
|
||||||
|
<id>sonatype-nexus</id>
|
||||||
|
<username>${env.SERVER_USERNAME}</username>
|
||||||
|
<password>${env.SERVER_PASSWORD}</password>
|
||||||
|
</server>
|
||||||
|
<server>
|
||||||
|
<id>github.com</id>
|
||||||
|
<username>nope</username>
|
||||||
|
<password>${env.GIT_ACTION_TOKEN}</password>
|
||||||
|
</server>
|
||||||
|
</servers>
|
||||||
|
</settings>
|
31
.github/workflows/build.yaml
vendored
Normal file
31
.github/workflows/build.yaml
vendored
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
MAVEN_ARGS: --batch-mode --color=always --no-transfer-progress --settings=.github/settings.xml
|
||||||
|
steps:
|
||||||
|
- run: git config --global user.name "${{ vars.KOKUWA_IO_BOT_NAME }}"
|
||||||
|
- run: git config --global user.email "${{ vars.KOKUWA_IO_BOT_EMAIL }}"
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GIT_ACTION_TOKEN }}
|
||||||
|
- uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 17
|
||||||
|
cache: maven
|
||||||
|
- run: mvn $MAVEN_ARGS dependency:go-offline
|
||||||
|
- run: mvn $MAVEN_ARGS deploy
|
||||||
|
env:
|
||||||
|
SERVER_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
|
||||||
|
SERVER_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
|
||||||
|
- run: mvn $MAVEN_ARGS site-deploy
|
||||||
|
env:
|
||||||
|
GIT_ACTION_TOKEN: ${{ secrets.GIT_ACTION_TOKEN }}
|
87
.github/workflows/ci.yaml
vendored
87
.github/workflows/ci.yaml
vendored
|
@ -1,87 +0,0 @@
|
||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
pull_request: {}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
yaml:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: ibiqlik/action-yamllint@v3
|
|
||||||
with:
|
|
||||||
format: colored
|
|
||||||
strict: true
|
|
||||||
|
|
||||||
markdown:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: avto-dev/markdown-lint@v1
|
|
||||||
with:
|
|
||||||
args: /github/workspace
|
|
||||||
|
|
||||||
javadoc:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
distribution: temurin
|
|
||||||
java-version: 17
|
|
||||||
cache: maven
|
|
||||||
- run: mvn -B -ntp javadoc:javadoc-no-fork -Ddoclint=all
|
|
||||||
|
|
||||||
checkstyle:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
distribution: temurin
|
|
||||||
java-version: 17
|
|
||||||
cache: maven
|
|
||||||
- run: mvn -B -ntp checkstyle:check
|
|
||||||
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
distribution: temurin
|
|
||||||
java-version: 17
|
|
||||||
cache: maven
|
|
||||||
server-id: sonatype-nexus
|
|
||||||
server-username: SERVER_USERNAME
|
|
||||||
server-password: SERVER_PASSWORD
|
|
||||||
- run: mvn -B -ntp verify -Dcheckstyle.skip -Dmaven.test.redirectTestOutputToFile=false
|
|
||||||
if: ${{ github.ref != 'refs/heads/main' }}
|
|
||||||
- run: mvn -B -ntp deploy -Dcheckstyle.skip -Dmaven.test.redirectTestOutputToFile=false
|
|
||||||
if: ${{ github.ref == 'refs/heads/main' }}
|
|
||||||
env:
|
|
||||||
SERVER_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
|
|
||||||
SERVER_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
|
|
||||||
|
|
||||||
versions:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
version:
|
|
||||||
- 21.0.0
|
|
||||||
- 21.0.1
|
|
||||||
- 21.0.2
|
|
||||||
- 21.1.0
|
|
||||||
- 21.1.1
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
distribution: temurin
|
|
||||||
java-version: 17
|
|
||||||
cache: maven
|
|
||||||
- run: mvn -B -ntp verify -Dcheckstyle.skip -Dmaven.test.redirectTestOutputToFile=false -Dversion.org.keycloak=${{ matrix.version }}
|
|
17
.github/workflows/dependabot.yaml
vendored
17
.github/workflows/dependabot.yaml
vendored
|
@ -1,17 +0,0 @@
|
||||||
name: Dependabot
|
|
||||||
|
|
||||||
on: pull_request_target
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
auto-merge:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.actor == 'dependabot[bot]' }}
|
|
||||||
steps:
|
|
||||||
- run: gh pr review --approve "$PR_URL"
|
|
||||||
env:
|
|
||||||
PR_URL: ${{ github.event.pull_request.html_url }}
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GIT_ACTION_TOKEN }}
|
|
||||||
- run: gh pr merge --auto --squash "$PR_URL"
|
|
||||||
env:
|
|
||||||
PR_URL: ${{ github.event.pull_request.html_url }}
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GIT_ACTION_TOKEN }}
|
|
59
.github/workflows/pr.yaml
vendored
Normal file
59
.github/workflows/pr.yaml
vendored
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
name: PullRequest
|
||||||
|
|
||||||
|
on: pull_request
|
||||||
|
|
||||||
|
env:
|
||||||
|
MAVEN_ARGS: --batch-mode --color=always --no-transfer-progress -Dmaven.test.redirectTestOutputToFile=false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
yaml:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ibiqlik/action-yamllint@v3
|
||||||
|
with:
|
||||||
|
format: colored
|
||||||
|
strict: true
|
||||||
|
|
||||||
|
markdown:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: avto-dev/markdown-lint@v1
|
||||||
|
with:
|
||||||
|
args: /github/workspace
|
||||||
|
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 17
|
||||||
|
cache: maven
|
||||||
|
- run: mvn $MAVEN_ARGS dependency:go-offline
|
||||||
|
- run: mvn $MAVEN_ARGS verify
|
||||||
|
- run: mvn $MAVEN_ARGS site
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
path: target/site
|
||||||
|
|
||||||
|
versions:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
version:
|
||||||
|
- 21.0.2
|
||||||
|
- 21.1.1
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 17
|
||||||
|
cache: maven
|
||||||
|
- run: mvn $MAVEN_ARGS verify -Dcheck.skip -Dversion.org.keycloak=${{ matrix.version }}
|
10
.github/workflows/release.yaml
vendored
10
.github/workflows/release.yaml
vendored
|
@ -5,7 +5,11 @@ on: workflow_dispatch
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
MAVEN_ARGS: --batch-mode --color=always --no-transfer-progress --settings=.github/settings.xml
|
||||||
steps:
|
steps:
|
||||||
|
- run: git config --global user.name "${{ vars.KOKUWA_IO_BOT_NAME }}"
|
||||||
|
- run: git config --global user.email "${{ vars.KOKUWA_IO_BOT_EMAIL }}"
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GIT_ACTION_TOKEN }}
|
token: ${{ secrets.GIT_ACTION_TOKEN }}
|
||||||
|
@ -25,9 +29,11 @@ jobs:
|
||||||
server-password: SERVER_PASSWORD
|
server-password: SERVER_PASSWORD
|
||||||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
|
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
gpg-passphrase: GPG_PASSPHRASE
|
gpg-passphrase: GPG_PASSPHRASE
|
||||||
- run: mvn -B -ntp release:prepare
|
- run: mvn $MAVEN_ARGS dependency:go-offline
|
||||||
- run: mvn -B -ntp release:perform
|
- run: mvn $MAVEN_ARGS release:prepare -Darguments="$MAVEN_ARGS"
|
||||||
|
- run: mvn $MAVEN_ARGS release:perform -Darguments="$MAVEN_ARGS"
|
||||||
env:
|
env:
|
||||||
SERVER_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
|
SERVER_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
|
||||||
SERVER_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
|
SERVER_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
|
||||||
|
GIT_ACTION_TOKEN: ${{ secrets.GIT_ACTION_TOKEN }}
|
||||||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
|
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# do not include developer stuff here, use `git config --global core.excludesFile ~/.gitignore` for your setup
|
||||||
|
|
||||||
|
target
|
||||||
|
pom.xml.releaseBackup
|
||||||
|
release.properties
|
|
@ -1,10 +1,10 @@
|
||||||
# Keycloak Metrics
|
# Keycloak Metrics
|
||||||
|
|
||||||
Provides metrics for Keycloak user/admin events and user/client/session count. Tested on Keycloak [20-21](.github/workflows/ci.yaml#L74-L77).
|
Provides metrics for Keycloak user/admin events and user/client/session count. Tested on Keycloak [21](.github/workflows/pr.yaml#L49-L51).
|
||||||
|
|
||||||
[](http://www.apache.org/licenses/)
|
[](http://www.apache.org/licenses/)
|
||||||
[](https://central.sonatype.com/search?namespace=io.kokuwa.keycloak&q=keycloak-event-metrics)
|
[](https://central.sonatype.com/search?namespace=io.kokuwa.keycloak&q=keycloak-event-metrics)
|
||||||
[](https://github.com/kokuwaio/keycloak-event-metrics/actions/workflows/ci.yaml?query=branch%3Amain)
|
[](https://github.com/kokuwaio/keycloak-event-metrics/actions/workflows/build.yaml)
|
||||||
|
|
||||||
## Why?
|
## Why?
|
||||||
|
|
||||||
|
|
350
pom.xml
350
pom.xml
|
@ -2,6 +2,13 @@
|
||||||
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>io.kokuwa.maven</groupId>
|
||||||
|
<artifactId>maven-parent</artifactId>
|
||||||
|
<version>0.6.10</version>
|
||||||
|
<relativePath/>
|
||||||
|
</parent>
|
||||||
|
|
||||||
<groupId>io.kokuwa.keycloak</groupId>
|
<groupId>io.kokuwa.keycloak</groupId>
|
||||||
<artifactId>keycloak-event-metrics</artifactId>
|
<artifactId>keycloak-event-metrics</artifactId>
|
||||||
<version>1.0.1-SNAPSHOT</version>
|
<version>1.0.1-SNAPSHOT</version>
|
||||||
|
@ -16,19 +23,21 @@
|
||||||
</organization>
|
</organization>
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
<name>Apache License 2.0</name>
|
<name>Apache-2.0</name>
|
||||||
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
|
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||||
|
<distribution>repo</distribution>
|
||||||
</license>
|
</license>
|
||||||
</licenses>
|
</licenses>
|
||||||
|
|
||||||
<developers>
|
<developers>
|
||||||
<developer>
|
<developer>
|
||||||
<id>stephanschnabel</id>
|
<id>sschnabe</id>
|
||||||
<name>Stephan Schnabel</name>
|
<name>Stephan Schnabel</name>
|
||||||
<url>https://github.com/sschnabe</url>
|
<url>https://github.com/sschnabe</url>
|
||||||
<email>stephan@grayc.de</email>
|
<email>stephan@grayc.de</email>
|
||||||
<organization>GrayC GmbH</organization>
|
<organization>GrayC GmbH</organization>
|
||||||
<organizationUrl>https://grayc.de</organizationUrl>
|
<organizationUrl>https://grayc.de</organizationUrl>
|
||||||
|
<timezone>Europe/Berlin</timezone>
|
||||||
</developer>
|
</developer>
|
||||||
</developers>
|
</developers>
|
||||||
|
|
||||||
|
@ -46,16 +55,6 @@
|
||||||
<system>github</system>
|
<system>github</system>
|
||||||
<url>https://github.com/kokuwaio/keycloak-event-metrics/actions</url>
|
<url>https://github.com/kokuwaio/keycloak-event-metrics/actions</url>
|
||||||
</ciManagement>
|
</ciManagement>
|
||||||
<distributionManagement>
|
|
||||||
<snapshotRepository>
|
|
||||||
<id>sonatype-nexus</id>
|
|
||||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
|
||||||
</snapshotRepository>
|
|
||||||
<repository>
|
|
||||||
<id>sonatype-nexus</id>
|
|
||||||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
|
|
||||||
</repository>
|
|
||||||
</distributionManagement>
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
||||||
|
@ -63,73 +62,27 @@
|
||||||
<!-- =============================== Build =============================== -->
|
<!-- =============================== Build =============================== -->
|
||||||
<!-- ===================================================================== -->
|
<!-- ===================================================================== -->
|
||||||
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
|
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
|
|
||||||
<maven.compiler.showWarnings>true</maven.compiler.showWarnings>
|
|
||||||
<maven.compiler.failOnWarning>true</maven.compiler.failOnWarning>
|
|
||||||
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
|
|
||||||
|
|
||||||
<!-- ===================================================================== -->
|
<!-- ===================================================================== -->
|
||||||
<!-- ============================== Libaries ============================= -->
|
<!-- ============================== Libaries ============================= -->
|
||||||
<!-- ===================================================================== -->
|
<!-- ===================================================================== -->
|
||||||
|
|
||||||
<!-- plugins -->
|
|
||||||
|
|
||||||
<version.org.apache.maven.plugins.checkstyle>3.2.2</version.org.apache.maven.plugins.checkstyle>
|
|
||||||
<version.org.apache.maven.plugins.clean>3.2.0</version.org.apache.maven.plugins.clean>
|
|
||||||
<version.org.apache.maven.plugins.compiler>3.11.0</version.org.apache.maven.plugins.compiler>
|
|
||||||
<version.org.apache.maven.plugins.dependency>3.5.0</version.org.apache.maven.plugins.dependency>
|
|
||||||
<version.org.apache.maven.plugins.deploy>3.1.1</version.org.apache.maven.plugins.deploy>
|
|
||||||
<version.org.apache.maven.plugins.gpg>3.0.1</version.org.apache.maven.plugins.gpg>
|
|
||||||
<version.org.apache.maven.plugins.install>3.1.1</version.org.apache.maven.plugins.install>
|
|
||||||
<version.org.apache.maven.plugins.jar>3.3.0</version.org.apache.maven.plugins.jar>
|
|
||||||
<version.org.apache.maven.plugins.javadoc>1.0.0</version.org.apache.maven.plugins.javadoc>
|
|
||||||
<version.org.apache.maven.plugins.release>3.0.0</version.org.apache.maven.plugins.release>
|
|
||||||
<version.org.apache.maven.plugins.resources>3.3.1</version.org.apache.maven.plugins.resources>
|
|
||||||
<version.org.apache.maven.plugins.source>3.2.1</version.org.apache.maven.plugins.source>
|
|
||||||
<version.org.apache.maven.plugins.surefire>3.0.0</version.org.apache.maven.plugins.surefire>
|
|
||||||
<version.org.codehaus.mojo.tidy>1.2.0</version.org.codehaus.mojo.tidy>
|
|
||||||
<version.org.sonatype.plugins.nexus-staging>1.6.13</version.org.sonatype.plugins.nexus-staging>
|
|
||||||
<version.com.puppycrawl.tools.checkstyle>10.10.0</version.com.puppycrawl.tools.checkstyle>
|
|
||||||
<version.io.kokuwa.checkstyle>0.5.6</version.io.kokuwa.checkstyle>
|
|
||||||
|
|
||||||
<!-- dependencies -->
|
|
||||||
|
|
||||||
<version.org.keycloak>21.1.1</version.org.keycloak>
|
<version.org.keycloak>21.1.1</version.org.keycloak>
|
||||||
<version.org.mockito>5.3.1</version.org.mockito>
|
<version.org.testcontainers>1.18.3</version.org.testcontainers>
|
||||||
<version.org.testcontainers>1.18.0</version.org.testcontainers>
|
|
||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- keycloak -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-parent</artifactId>
|
<artifactId>keycloak-quarkus-server</artifactId>
|
||||||
<version>${version.org.keycloak}</version>
|
<version>${version.org.keycloak}</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- test -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mockito</groupId>
|
|
||||||
<artifactId>mockito-junit-jupiter</artifactId>
|
|
||||||
<version>${version.org.mockito}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.testcontainers</groupId>
|
|
||||||
<artifactId>testcontainers-bom</artifactId>
|
|
||||||
<version>${version.org.testcontainers}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -152,27 +105,61 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.keycloak</groupId>
|
||||||
<artifactId>keycloak-quarkus-server</artifactId>
|
<artifactId>keycloak-admin-client</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>test</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion><!-- references ancient `commons-io` -->
|
<exclusion>
|
||||||
<groupId>com.openshift</groupId>
|
<groupId>org.glassfish.jaxb</groupId>
|
||||||
<artifactId>openshift-restclient-java</artifactId>
|
<artifactId>jaxb-runtime</artifactId>
|
||||||
</exclusion>
|
|
||||||
<exclusion><!-- https://github.com/keycloak/keycloak/issues/19850 -->
|
|
||||||
<groupId>org.keycloak</groupId>
|
|
||||||
<artifactId>keycloak-admin-ui</artifactId>
|
|
||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>org.jboss.resteasy</groupId>
|
||||||
<artifactId>keycloak-account-ui</artifactId>
|
<artifactId>resteasy-multipart-provider</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- libraries -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jboss.logging</groupId>
|
||||||
|
<artifactId>jboss-logging</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.hibernate</groupId>
|
||||||
|
<artifactId>hibernate-core</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>javax.xml.bind</groupId>
|
||||||
|
<artifactId>jaxb-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.glassfish.jaxb</groupId>
|
||||||
|
<artifactId>jaxb-runtime</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.hibernate.common</groupId>
|
||||||
|
<artifactId>hibernate-commons-annotations</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.jboss</groupId>
|
||||||
|
<artifactId>jandex</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>antlr</groupId>
|
||||||
|
<artifactId>antlr</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.fasterxml</groupId>
|
||||||
|
<artifactId>classmate</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.keycloak</groupId>
|
<groupId>io.micrometer</groupId>
|
||||||
<artifactId>keycloak-admin-client</artifactId>
|
<artifactId>micrometer-core</artifactId>
|
||||||
<scope>test</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- test -->
|
<!-- test -->
|
||||||
|
@ -183,13 +170,7 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.testcontainers</groupId>
|
<groupId>org.testcontainers</groupId>
|
||||||
<artifactId>junit-jupiter</artifactId>
|
<artifactId>testcontainers</artifactId>
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency><!-- is missing and necessary for `keycloak-admin-client` -->
|
|
||||||
<groupId>org.wildfly.client</groupId>
|
|
||||||
<artifactId>wildfly-client-config</artifactId>
|
|
||||||
<version>1.0.1.Final</version>
|
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -202,151 +183,8 @@
|
||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
</testResource>
|
</testResource>
|
||||||
</testResources>
|
</testResources>
|
||||||
<pluginManagement>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
|
||||||
<version>${version.org.apache.maven.plugins.checkstyle}</version>
|
|
||||||
<configuration>
|
|
||||||
<configLocation>checkstyle.xml</configLocation>
|
|
||||||
<suppressionsLocation>checkstyle-suppression.xml</suppressionsLocation>
|
|
||||||
<includeTestSourceDirectory>true</includeTestSourceDirectory>
|
|
||||||
</configuration>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.puppycrawl.tools</groupId>
|
|
||||||
<artifactId>checkstyle</artifactId>
|
|
||||||
<version>${version.com.puppycrawl.tools.checkstyle}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.kokuwa</groupId>
|
|
||||||
<artifactId>maven-parent</artifactId>
|
|
||||||
<version>${version.io.kokuwa.checkstyle}</version>
|
|
||||||
<type>zip</type>
|
|
||||||
<classifier>checkstyle</classifier>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-clean-plugin</artifactId>
|
|
||||||
<version>${version.org.apache.maven.plugins.clean}</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>${version.org.apache.maven.plugins.compiler}</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
|
||||||
<version>${version.org.apache.maven.plugins.dependency}</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-deploy-plugin</artifactId>
|
|
||||||
<version>${version.org.apache.maven.plugins.deploy}</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-failsafe-plugin</artifactId>
|
|
||||||
<version>${version.org.apache.maven.plugins.surefire}</version>
|
|
||||||
<configuration>
|
|
||||||
<failIfNoTests>true</failIfNoTests>
|
|
||||||
<redirectTestOutputToFile>${maven.test.redirectTestOutputToFile}</redirectTestOutputToFile>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-gpg-plugin</artifactId>
|
|
||||||
<version>${version.org.apache.maven.plugins.gpg}</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-install-plugin</artifactId>
|
|
||||||
<version>${version.org.apache.maven.plugins.install}</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
|
||||||
<version>${version.org.apache.maven.plugins.jar}</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
<version>${version.org.apache.maven.plugins.jar}</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-release-plugin</artifactId>
|
|
||||||
<version>${version.org.apache.maven.plugins.release}</version>
|
|
||||||
<configuration>
|
|
||||||
<tagNameFormat>@{project.version}</tagNameFormat>
|
|
||||||
<releaseProfiles>release</releaseProfiles>
|
|
||||||
<localCheckout>true</localCheckout>
|
|
||||||
<signTag>true</signTag>
|
|
||||||
<scmReleaseCommitComment>@{prefix} prepare release @{releaseLabel} [no ci]</scmReleaseCommitComment>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
|
||||||
<version>${version.org.apache.maven.plugins.source}</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
|
||||||
<version>${version.org.apache.maven.plugins.resources}</version>
|
|
||||||
<configuration>
|
|
||||||
<propertiesEncoding>UTF-8</propertiesEncoding>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<version>${version.org.apache.maven.plugins.surefire}</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>tidy-maven-plugin</artifactId>
|
|
||||||
<version>${version.org.codehaus.mojo.tidy}</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.sonatype.plugins</groupId>
|
|
||||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
|
||||||
<version>${version.org.sonatype.plugins.nexus-staging}</version>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</pluginManagement>
|
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
||||||
<!-- fail if any pom is dirty -->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>tidy-maven-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>check</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<!-- fail if checkstyle reports problems -->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>check</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<!-- run tests -->
|
<!-- run tests -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
@ -363,66 +201,4 @@
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<profiles>
|
|
||||||
<profile>
|
|
||||||
<id>release</id>
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
|
|
||||||
<!-- add source for downstream projects -->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>jar-no-fork</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<!-- add javadoc for downstream projects -->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<!-- sign documents before upload -->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-gpg-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>sign</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<!-- autoclose sonatype nexus repo -->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.sonatype.plugins</groupId>
|
|
||||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
|
||||||
<extensions>true</extensions>
|
|
||||||
<configuration>
|
|
||||||
<serverId>sonatype-nexus</serverId>
|
|
||||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
|
||||||
<autoReleaseAfterClose>true</autoReleaseAfterClose>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -41,12 +41,11 @@ public class MetricsStatsTask implements Provider, ScheduledTask {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
scrape(session);
|
scrape(session);
|
||||||
|
} catch (org.hibernate.exception.SQLGrammarException e) {
|
||||||
|
log.infov("Metrics status task skipped, database not ready.");
|
||||||
|
return;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (e instanceof org.hibernate.exception.SQLGrammarException) {
|
log.errorv(e, "Failed to scrape stats.");
|
||||||
log.infov("Metrics status task skipped, database not ready.");
|
|
||||||
} else {
|
|
||||||
log.errorv(e, "Failed to scrape stats.");
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,6 +66,7 @@ public class MetricsStatsTask implements Provider, ScheduledTask {
|
||||||
|
|
||||||
private void scrape(KeycloakSession session) {
|
private void scrape(KeycloakSession session) {
|
||||||
session.realms().getRealmsStream().forEach(realm -> {
|
session.realms().getRealmsStream().forEach(realm -> {
|
||||||
|
log.tracev("Scrape for realm {0}.", realm.getName());
|
||||||
var tagRealm = Tag.of("realm", realm.getName());
|
var tagRealm = Tag.of("realm", realm.getName());
|
||||||
gauge("keycloak_users", Set.of(tagRealm), session.users().getUsersCount(realm), true);
|
gauge("keycloak_users", Set.of(tagRealm), session.users().getUsersCount(realm), true);
|
||||||
gauge("keycloak_clients", Set.of(tagRealm), session.clients().getClientsCount(realm), true);
|
gauge("keycloak_clients", Set.of(tagRealm), session.clients().getClientsCount(realm), true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue