<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Thanks for sharing.<br>
<br>
Some of my tips: Whenever possible, I am using KeycloakServer from
testsuite for development. This uses Keycloak on embedded Undertow
instead of Wildfly/EAP. This is not possible just when I need to
develop/test something, which really requires "real" Wildfly/EAP6
environment (examples, subsystems, doublecheck that modules.xml
are not broken etc)<br>
<br>
In addition, when I add system property "-Dresources", the UI
development is super-easy because:<br>
- Caching headers are disabled on server side for theme files, so
browser caching is effectively disabled<br>
- Themes use local filesystem<br>
<br>
In other words, when I do some change in HTML or JS file, there is
no need to restart server. It's sufficient to logout/login to see
all your changes<br>
<br>
Also I am using Mongo for development when possible. This has
advantage that data are persistent among restarts and
KeycloakServer restart took me around 2 seconds.<br>
<br>
Marek<br>
<br>
<br>
On 06/10/15 20:47, Stan Silvert wrote:<br>
</div>
<blockquote cite="mid:5614172D.6010709@redhat.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
keycloak-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-dev">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a></pre>
</blockquote>
<br>
</body>
</html>