An end-to-end OptaPlanner web application ready to deploy on OpenShift 3.
See the video demo.
-
Install the oc client tools
To copy-paste your command, go to the OpenShift Online web console and look for Help > Command line tools.
-
Login to OpenShift Dedicated from command line:
oc login https://api.YOUR_SERVER.openshift.com --token=<tokenId>
If you don’t know your
<tokenId>
, log in at the OpenShift web console and look for Help > Command Line Tools. -
Create, build and deploy the project.
./provision.sh setup --project-suffix mydemo
The
--project-suffix
is optional. -
It should now be building the pod and running it on OpenShift. Go to the OpenShift Online web console to get the
*.openshiftapps.com
URL to visit.
-
If you just installed oc client tools, follow the OpenShift Local Cluster Management docs to get
oc cluster (up|down)
working. -
oc cluster up
-
oc login
, enterdeveloper
for both username and password when prompted -
oc new-project optaweb-employee-rostering
-
oc new-app --image-stream="openshift/wildfly:10.1" https://github.com/kiegroup/optaweb-employee-rostering.git#master
To trigger a new build with the latest updates from the master branch, run
oc start-build optaweb-employee-rostering
To delete the OpenShift application and project, run
oc delete project optaweb-employee-rostering
Both IntelliJ and Eclipse formatters are available here: https://github.com/kiegroup/droolsjbpm-build-bootstrap/tree/master/ide-configuration
mvn clean install
Under the covers, OpenShift builds activate the openshift
profile.
To reproduce locally, add it explicitly (the provision.sh
script already does this):
mvn clean package -P openshift
To run SuperDevMode and debug both backend and client code from IDEA you need to create two separate run configurations.
-
Create Maven configuration and set following parameters:
-
Working directory:
/absolute/path/optaweb-employee-rostering
-
Command line:
gwt:codeserver
-
-
Make sure
launcherDir
is configured to point tooptaweb-employee-rostering-webapp/target/optaweb-employee-rostering-webapp-${version}/
.The
launcherDir
property can be set inpom.xml
or via system property.
-
Add local JBoss Server configuration.
-
Configure the Application server field to point to a local WildFly 11 installation.
-
Click Fix button at the bottom of the dialogue and select
optaweb-employee-rostering-webbab:war exploded
. -
Remove any steps that were automatically added to the Before launch phase.
-
Configure JavaScript debugger:
-
Check After launch and select Chrome browser.
-
Check with JavaScript debugger.
-
Set start page to
http://localhost:8080/gwtui/gwtui.html
. -
Set both On Update action and On frame deactivation to Update classes and resources.
-
-
Do a clean build:
mvn clean install -DskipTests
-
Run the CodeServer configuration in normal mode.
-
Run the AppServer configuration in debug mode.
You get live update for backend code. You can see client code changes after refreshing the browser or Rerunning the JavaScript debugger. And you can debug both client and backend code in IDEA.
If something goes wrong, do a clean build and click Maven Projects > Reimport All Maven Projects.
The steps below make sure that the GWT Codeserver will recompile the application after files under src/main/resources
are saved.
-
Import the maven project by choosing the root
pom.xml
file and selectingOpen as project
-
Install the
Save Actions
plugin -
Restart IntelliJ (required after installing the plugin)
-
Under
Other settings
, go to theSave Actions
submenu and check either the first or the second options in theGeneral
section -
Check the
Compile file
option in theBuild actions
section
After configuring the Save Actions
plugin, you should be able to start Wildfly and deploy the application from the CLI. Note that if you need to restart the GWT Code Server, it’s not mandatory to restart Wildfly.
mvn -N wildfly:start wildfly:deploy
mvn gwt:codeserver
To stop the Wildfly server, use mvn -N wildfly:shutdown
.