<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
In talking with Marko, I shared some of my hacking tips to aid with
i18n/l10n development. But they are generally handy for easing all
Keycloak development. Others might have other ways to improve on
this stuff and make our lives easier?<br>
<br>
Here are mine:<br>
<br>
<b>Build server-dist without artifacts<br>
</b>I think Bill gets the credit for making this possible in
WildFly. You can build it such that jars are not copied to the
server. Instead, they are retrieved from your local maven repo.
For Keycloak, you go to
/distribution/server-dist/server-provisioning.xml and set
copy-module-artifacts="false".<br>
<br>
Now when you compile any of Keycloak's java modules you just restart
the server and see your changes.<br>
<br>
It would be nice if we could use a system property for this, but it
looks like server-provisioning.xml doesn't support props for that
attribute. Some day I'll fix it and submit a patch.<br>
<br>
Anyway, doing that and running mvn compile instead of mvn install
brings the build time from 3 minutes to about 6 seconds. Only 6
seconds to build the whole server!<br>
<br>
I use Windows and Cygwin to do this automatically in a batch file:<br>
<br>
cd c:\GitHub\keycloak\distribution\server-dist<br>
call mvn clean<br>
sed -i
's/copy-module-artifacts="true"/copy-module-artifacts="false"/'
server-provisioning.xml<br>
call mvn compile<br>
sed -i
's/copy-module-artifacts="false"/copy-module-artifacts="true"/'
server-provisioning.xml<br>
<br>
<b>Let the the default theme point to your maven clone instead of
/standalone/configuration/themes<br>
</b>You can tell Keycloak to load the default theme from your
development environment. This is especially handy when you are
working on HTML or JS files for Keycloak Admin Console. To do this,
edit keycloak-server.json. Here is the batch file code I use to
automate it:<br>
<br>
cd
c:\GitHub\keycloak\distribution\server-dist\target\keycloak*\standalone\configuration<br>
sed -i 's,"dir": "${jboss.server.config.dir}/themes","dir":
"/GitHub/keycloak/forms/common-themes/src/main/resources/theme",'
keycloak-server.json<br>
<br>
Note: I had to use a comma for my sed delimiter instead of forward
slash /<br>
<br>
<b>Turn off caching in your browser.<br>
</b>You need to turn off caching to see your HTML and JS changes as
soon as you edit them. But it can be a pain to turn caching on and
off. I found a nifty FireFox extension called "Cache Disabler" that
puts a little button in my toolbar to enable/disable all caching.<br>
<br>
</body>
</html>