-
Notifications
You must be signed in to change notification settings - Fork 21
Deployment
To quickly start backend including an embedded MongoDB you can follow these steps:
- Make sure you have built the backend with
mvn install -DskipTests. - Change to the
wardirectory. - Copy
settings.xmlfrom thewardirectory to your Maven home (typically~/.m2), or copy&paste its content to the relevant parts of your existingsettings.xmlfile. - While still located in the
wardirectory, runmvn wildfly:run -PstartEngine. - To stop the running backend, simply press
Ctrl+C.
The rest of this document describes how to use IntelliJ IDEA to quickly deploy the application to WildFly application server during the development process. You will need Ultimate Edition since the features used here are not available in the Community Edition. Most of the steps and principles can be applied to another IDE as well. While deploying the backend to an externally started WildFly server, you also need a standalone MongoDB instance running.
A local instance of MongoDB is needed when: deploying application to a standalone WildFly server. Separate MongoDB is not needed when: running tests (they span their own embedded MongoDB), when starting backed via Maven (as described above).
You can either use docker or the manual way listed below. For docker, run docker run -itd -p 27017:27017 --name my-mongo mongo. To stop it run docker stop my-mongo. To start it again later with the previous data run docker start my-mongo. To discard it, while stopped run docker rm my-mongo.
Alternative manual way:
- Install MongoDB
- Go to MongoDB Download Center
- Download the latest MongoDB for your platform
- Install MongoDB according to the instructions on the website
- Run MongoDB
- Run
mongodin the command line - Keep it running during the development process
- Run
You can use MongoDB plugin for IntelliJ IDEA to see the actual content of the database.
Prerequisite: Installed JDK 11.
After importing the Maven project open File -> Project Structure... and check the following:
- SDKs has JDK 11 added.
- Project has Projeck SDK set to version 11 and Project language level to 11 as well.
- In Modules all modules' language level set to 11.
In order to be able to deploy the application by one click, you will need to configure WildFly in your IDE:
- Prepare WildFly application server
- Open a command line in the
enginefolder - Run
mvn clean install -DskipTests - Go to
war/targetfolder - Copy
wildfly-14.0.1.Finalto some other location (preferably outside of the project)
- Open a command line in the
- Enable JBoss Integration plugin
- Open IntelliJ IDEA
- Go to File -> Settings -> Plugins
- Find and check JBoss Integration
- Apply the changes and restart the IDE
- Add a new application server
- Go to File -> Settings -> Build, Execution, Deployment -> Application Servers
- Click on a green plus button (Add application server)
- Select the path to your copy of
wildfly-14.0.1.Finaldirectory - Save the changes
- Modify Run/Debug Configurations
- Go to Run -> Edit Configurations...
- Click on a green plus button
- Select JBoss Server -> Local
- Change the name to Lumeer WildFly
- Choose the previously added application server
- Change the URL to
http://localhost:8080/lumeer-engine - Configure VM options to:
--add-modules=java.se - On the Deployment tab add new artifact
engine-war:war - Set environment property
SKIP_SECURITY=true - Save the settings
After you have successfully configured both MongoDB and WildFly, you can run the application from your IDE:
- Deploy the application
- Select previously created Lumeer WildFly configuration in the top right corner of the screen.
- Click run button and wait for the deployment
- Access some REST endpoint from your browser
- Redeploy the application
- Make some changes in the code
- Click Update application button in the left panel on the bottom of the screen
- Choose if you want to restart the whole server or just redeploy the application
See web-ui README.