Add Maven build for the Admin UI (#17552)

This commit is contained in:
Jon Koops 2023-03-13 19:16:12 +01:00 committed by GitHub
parent fe5d89295f
commit 96aa4b3394
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 144 additions and 141 deletions

View file

@ -1,58 +0,0 @@
<?xml version="1.0"?>
<!--
~ Copyright 2016 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<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/maven-v4_0_0.xsd">
<parent>
<artifactId>keycloak-dependencies-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>999.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>keycloak-dependencies-admin-ui-wrapper</artifactId>
<packaging>jar</packaging>
<name>Keycloak Admin UI BOM wrapper</name>
<description>
BOM wrapper for Admin UI to limit Sonatype snapshot repository to admin-ui
</description>
<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-ui</artifactId>
<type>jar</type>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<name>Sonatype Snapshots</name>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
</project>

14
dependencies/pom.xml vendored
View file

@ -35,18 +35,4 @@
<module>server-all</module> <module>server-all</module>
</modules> </modules>
<profiles>
<profile>
<id>skip-admin2</id>
<activation>
<property>
<name>!skipAdmin2</name>
</property>
</activation>
<modules>
<module>admin-ui</module>
</modules>
</profile>
</profiles>
</project> </project>

View file

@ -57,12 +57,6 @@
<dependency> <dependency>
<groupId>org.keycloak</groupId> <groupId>org.keycloak</groupId>
<artifactId>keycloak-quarkus-server</artifactId> <artifactId>keycloak-quarkus-server</artifactId>
<exclusions>
<exclusion>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-ui</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.freemarker</groupId> <groupId>org.freemarker</groupId>

View file

@ -0,0 +1,10 @@
{
"themes": [
{
"name": "keycloak.v2",
"types": [
"admin"
]
}
]
}

View file

@ -0,0 +1 @@
parent=base

119
js/apps/admin-ui/pom.xml Normal file
View file

@ -0,0 +1,119 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>keycloak-js-parent</artifactId>
<groupId>org.keycloak</groupId>
<version>999.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>keycloak-admin-ui</artifactId>
<name>Keycloak Admin UI</name>
<description>The user inferface to administrate the Keycloak server.</description>
<build>
<resources>
<resource>
<directory>maven-resources</directory>
</resource>
<resource>
<directory>dist</directory>
<targetPath>theme/keycloak.v2/admin/resources</targetPath>
<excludes>
<exclude>index.html</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>npm-build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build --workspace=admin-ui</arguments>
</configuration>
</execution>
</executions>
<configuration>
<workingDirectory>../..</workingDirectory>
</configuration>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>maven-replacer-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>dist/index.html</file>
<outputFile>target/classes/theme/keycloak.v2/admin/index.ftl</outputFile>
<regex>false</regex>
<replacements>
<replacement>
<token>src="./</token>
<value>src="${resourceUrl}/</value>
</replacement>
<replacement>
<token>href="./</token>
<value>href="${resourceUrl}/</value>
</replacement>
<replacement>
<token><![CDATA[</body>]]></token>
<value xml:space="preserve">
<![CDATA[
<script id="environment" type="application/json">
{
"loginRealm": "${loginRealm!"master"}",
"authServerUrl": "${authServerUrl}",
"authUrl": "${authUrl}",
"consoleBaseUrl": "${consoleBaseUrl}",
"resourceUrl": "${resourceUrl}",
"masterRealm": "${masterRealm}",
"resourceVersion": "${resourceVersion}",
"isRunningAsTheme": true
}
</script>
</body>
]]>
</value>
</replacement>
<replacement>
<token><![CDATA[</head>]]></token>
<value xml:space="preserve">
<![CDATA[
<#if properties.styles?has_content>
<#list properties.styles?split(' ') as style>
<link href="${resourceUrl}/${style}" rel="stylesheet"/>
</#list>
</#if>
</head>
]]>
</value>
</replacement>
</replacements>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -16,6 +16,7 @@
<description>Parent of all JavaScript related code, sets up Node.js and NPM and installs dependencies for all projects in the workspace.</description> <description>Parent of all JavaScript related code, sets up Node.js and NPM and installs dependencies for all projects in the workspace.</description>
<modules> <modules>
<module>apps/admin-ui</module>
<module>libs/keycloak-admin-client</module> <module>libs/keycloak-admin-client</module>
<module>libs/keycloak-js</module> <module>libs/keycloak-js</module>
</modules> </modules>

12
pom.xml
View file

@ -56,8 +56,6 @@
<jboss.as.version>7.2.0.Final</jboss.as.version> <jboss.as.version>7.2.0.Final</jboss.as.version>
<jboss.as.subsystem.test.version>7.5.22.Final-redhat-1</jboss.as.subsystem.test.version> <jboss.as.subsystem.test.version>7.5.22.Final-redhat-1</jboss.as.subsystem.test.version>
<keycloak.admin-ui.version>${project.version}</keycloak.admin-ui.version>
<!-- Versions used mostly for Undertow server, aligned with WildFly --> <!-- Versions used mostly for Undertow server, aligned with WildFly -->
<jboss.aesh.version>0.66.19</jboss.aesh.version> <jboss.aesh.version>0.66.19</jboss.aesh.version>
<aesh.version>2.4</aesh.version> <aesh.version>2.4</aesh.version>
@ -179,7 +177,7 @@
<testcontainers.version>1.17.5</testcontainers.version> <testcontainers.version>1.17.5</testcontainers.version>
<!-- Maven Plugins --> <!-- Maven Plugins -->
<replacer.plugin.version>1.3.5</replacer.plugin.version> <replacer.plugin.version>1.4.1</replacer.plugin.version>
<jboss.as.plugin.version>7.5.Final</jboss.as.plugin.version> <jboss.as.plugin.version>7.5.Final</jboss.as.plugin.version>
<jmeter.plugin.version>1.9.0</jmeter.plugin.version> <jmeter.plugin.version>1.9.0</jmeter.plugin.version>
<jmeter.analysis.plugin.version>1.0.4</jmeter.analysis.plugin.version> <jmeter.analysis.plugin.version>1.0.4</jmeter.analysis.plugin.version>
@ -316,12 +314,6 @@
<artifactId>snakeyaml-engine</artifactId> <artifactId>snakeyaml-engine</artifactId>
<version>${org.snakeyaml.snakeyaml-engine.version}</version> <version>${org.snakeyaml.snakeyaml-engine.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-dependencies-admin-ui-wrapper</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency> <dependency>
<groupId>com.squareup.okhttp3</groupId> <groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId> <artifactId>okhttp</artifactId>
@ -1471,7 +1463,7 @@
<dependency> <dependency>
<groupId>org.keycloak</groupId> <groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-ui</artifactId> <artifactId>keycloak-admin-ui</artifactId>
<version>${keycloak.admin-ui.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.keycloak</groupId> <groupId>org.keycloak</groupId>

View file

@ -348,6 +348,16 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-ui</artifactId>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Keycloak Dependencies--> <!-- Keycloak Dependencies-->
<dependency> <dependency>
@ -665,39 +675,6 @@
</dependency> </dependency>
</dependencies> </dependencies>
<profiles>
<profile>
<id>skip-admin2</id>
<activation>
<property>
<name>!skipAdmin2</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-dependencies-admin-ui-wrapper</artifactId>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-ui</artifactId>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-rest-admin-ui-ext</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>

View file

@ -205,23 +205,10 @@
<artifactId>undertow-embedded</artifactId> <artifactId>undertow-embedded</artifactId>
<version>${undertow-embedded.version}</version> <version>${undertow-embedded.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-dependencies-admin-ui-wrapper</artifactId>
<type>pom</type>
<version>${project.version}</version>
<scope>import</scope>
</dependency>
<dependency> <dependency>
<groupId>org.keycloak</groupId> <groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-ui</artifactId> <artifactId>keycloak-admin-ui</artifactId>
<version>${keycloak.admin-ui.version}</version> <version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.keycloak</groupId> <groupId>org.keycloak</groupId>

View file

@ -48,12 +48,6 @@
<artifactId>keycloak-dependencies-server-all</artifactId> <artifactId>keycloak-dependencies-server-all</artifactId>
<type>pom</type> <type>pom</type>
</dependency> </dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-dependencies-admin-ui-wrapper</artifactId>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency> <dependency>
<groupId>org.keycloak</groupId> <groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-ui</artifactId> <artifactId>keycloak-admin-ui</artifactId>