参照官方文档building.md
mvn -Pdistribution -pl distribution/server-dist -am -Dmaven.test.skip clean install
报错
----------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.0:npm (npm-install-common) on project keycloak-themes: Failed to run task: 'npm ci --no-optional' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: -4058 (Exit value: -4058) -> [Help 1]
网络问题,换个镜像或者XXX
----------
[ERROR] Failed to execute goal org.hibernate.orm.tooling:hibernate-enhance-maven-plugin:5.3.24.Final:enhance (default) on project keycloak-model-map-jpa: Unable to enhance class: JpaRootAuthenticationSessionDelegateProvider.class: Failed to enhance class org.keycloak.models.map.storage.jpa.authSession.delegate.JpaRootAuthenticationSessionDelegateProvider: Unsupported class file major version 63 -> [Help 1]
降低JDK,我这直接从21降低到了8
----------
[ERROR] Failed to execute goal on project keycloak-adapter-feature-pack: Could not resolve dependencies for project org.keycloak:keycloak-adapter-feature-pack:pom:18.0.0: Failed to collect dependencies at org.wildfly:wildfly-feature-pack:zip:23.0.2.Final -> org.wildfly:wildfly-ee-feature-pack-common:pom:23.0.2.Final -> org.codehaus.jackson:jackson-core-asl:jar:1.9.13.redhat-00007: Failed to read artifact descriptor for org.codehaus.jackson:jackson-core-asl:jar:1.9.13.redhat-00007: Could not transfer artifact org.codehaus.jackson:jackson-core-asl:pom:1.9.13.redhat-00007 from/to redhat-enterprise-maven-repository (https://maven.repository.redhat.com/ga/): transfer failed for https://maven.repository.redhat.com/ga/org/codehaus/jackson/jackson-core-asl/1.9.13.redhat-00007/jackson-core-asl-1.9.13.redhat-00007.pom: Read timed out -> [Help 1]
完成
可以找到打完的包
\keycloak-18.0.0\distribution\server-dist\target