Skip to content

Latest commit

 

History

History
98 lines (63 loc) · 3.31 KB

building.md

File metadata and controls

98 lines (63 loc) · 3.31 KB

Building from source

Ensure you have JDK 11 (or newer), Maven 3.5.4 (or newer) and Git installed

java -version
mvn -version
git --version

NOTE

If you use Maven 3.8.1 or newer, please add the following mirror to your local ~/.m2/settings.xml to avoid build errors:

<mirrors>
  <mirror>
    <id>jboss-public-repository-group-https</id>
    <mirrorOf>jboss-public-repository-group</mirrorOf>
    <name>Jboss public https</name>
    <url>https://repository.jboss.org/nexus/content/groups/public/</url>
  </mirror>
</mirrors>

See KEYCLOAK-17812 for more details.


First clone the Morgana repository:

git clone https://github.com/MorganaToken/morgana-core.git
cd morgana-core

To build Morgana run:

mvn clean install

This will build all modules and run the testsuite.

To build the ZIP distribution run:

mvn clean install -Pdistribution -Dmaven.test.skip

Once completed you will find distribution archives in morgana-core/quarkus/dist.


NOTE

Classes from org.keycloak.testsuite.* packages aren't suitable to be used in production.


Building Quarkus Distribution

Please, take a look at this documentation.

Starting Morgana

To start Keycloak during development first build as specified above, then run:

mvn -f testsuite/utils/pom.xml exec:java -Pkeycloak-server 

When running testsuite, by default an account with username admin and password admin will be created within the master realm at start.

To start Morgana from the server distribution first build the distribution it as specified above, then run:

tar xfz morgana-core/quarkus/dist/target/keycloak-<VERSION>.tar.gz
cd keycloak-<VERSION>
bin/kc.sh start-dev

To stop the server press Ctrl + C.

Working with the codebase

We don't currently enforce a code style in Keycloak, but a good reference is the code style used by WildFly. This can be retrieved from Wildfly ide-configs.To import formatting rules, see following instructions.

If your changes require updates to the database read Updating Database Schema.

If your changes require introducing new dependencies or updating dependency versions please discuss this first on the dev mailing list. We do not accept new dependencies to be added lightly, so try to use what is available.

Building project from the IDE

Some parts of the project rely on generated code using Maven plugins. These steps might be skipped when building using IDE resulting in compilation errors. To work around this make sure to build the project first using Maven. After the initial build with Maven you should be able to build the project using the IDE as it will use the classes previously generated by Maven plugins. Make sure you don't rebuild the whole project using the IDE as it would delete the generated classes. E.g. in IntelliJ IDEA use Build → Build Project instead of Build → Rebuild Project.


NOTE

If you are building the Operator from your IDE, make sure to build the project with the operator profile enabled in Maven as it's excluded by default:

mvn clean install -Poperator -DskipTests