This page explains how to build, run and debug the console. We recommend to use Maven and the command line. This will work reliably across different environments and IDEs.
For a full build use
mvn clean install
This includes the GWT compiler, which might take a while. If you just want to make sure that there are no compilation or test failures, you can skip the GWT compiler and use
mvn clean install -Dgwt.skipCompilation
The maven build defines the following profiles:
dockerProduces the docker container
halconsole/halwhich runs the console in standalone mode
i18nCompiles the console with language support for German, Spanish, French, Portuguese, Chinese and Japanese
prodRuns the GWT compiler using production settings. Minimizes the CSS and JavaScrip code.
releaseSigns the maven artifacts, builds and attaches Javadoc
siteBuilds the maven site
theme-eapApplies the EAP theme
theme-halApplies the HAL theme
theme-wildflyApplies the WildFly theme
HAL contains some scripts for typical development tasks. Here’s a short description of the scripts and what they’re used for:
app/refresh.sh: Rebuilds certain resources when running the GWT development mode (see below)
loc.sh: Calculates code metrics such as LoC per file type
release.sh: Builds and deploys HAL using profiles
release,prod,theme-hal,dockerand pushes the latest console build to https://hal.github.io/console/
snapshot.sh: Builds and deploys the latest snapshot
versionBump.sh: Bumps the version in all POMs and some documentation files
zanata.sh: Syncs the i18n resources with the Zanata translation service.
HAL is a GWT application and as such it is served from a local Jetty server. As a one time prerequisite you need to add the URL of the local Jetty server as an allowed origin to your WildFly / JBoss EAP configuration:
/host=master/core-service=management/management-interface=http-interface:list-add(name=allowed-origins,value=http://localhost:8888) reload --host=master
The main GWT application is located in the
app folder. To run the console use
cd app mvn gwt:devmode
This will start the development mode. Wait until you see a message like
00:00:15,703 [INFO] Code server started in 15.12 s ms
In Chrome open the development tools and switch to the ‘Sources’ tab. Press ⌘ P and type the name of the Java source file you want to open.
Let’s say we want to debug the enable / disable action in the data source column in configuration. Open the class
DataSourceColumn and put a breakpoint on the first line of method
void setEnabled(ResourceAddress, boolean, SafeHtml) (should be line 285). Now select a data source like the default ‘ExampleDS’ data source and press the enable / disable link in the preview. The browser should stop at the specified line and you can use the development tools to inspect and change variables.
_0_g$. We recommend to inspect these variables using the console and call the
toString() method on the respective object.
To apply changes made to Java code you just need to refresh the browser. GWT will detect the modifications and only transpile the changed sources.
Changes to other resources require a little bit more effort. To make it easier, you can use the script
app/refresh.sh. Change to the
app folder and call
refresh.sh with one of the following parameters, depending what kind of resource you’ve modified:
less: Compile LESS stylesheets
html: Update HTML snippets
i18n: Process i18n resource bundles
mbui: Regenerate MBUI resources
After calling the script, refresh the browser to see your changes.