Deploying Your Business Logic on Another Server
Deploying Your Business Logic on Another Server
When you change Java service code, Eclipse compiles your changes on the fly - when you save the file. Eclipse java compiler reads the source code from your .java files (source code) and compiles it to .class files that the server can execute.
You need to:
- Package all Java and schema files into the WAR file.
- Deploy the WAR file to the application server.
Creating the WAR file
WAR (Web Application Archive) is a standard file format for JEE web application deployment. The WAR file contains all Java, schema, and WEB-INF configuration files packaged into a single file using the ZIP compression.
Your Eclipse application extension configuration contains a set of Gradle build tasks. Gradle is a popular build automation tool ( https://gradle.org/ ). You will need to run the war task to create the WAR file:
- In Eclipse, open the Gradle Tasks view.
- Select the webcentral-war-root / build / war task.
-
Right click and select Run Gradle Tasks from the menu:
-
Eclipse starts the build and you can see its progress in the Gradle Executions window. It usually takes several minutes to create the WAR file.
-
As a part of the build, Gradle runs all unit tests. If any unit test fails, the build stops.
-
The resulting WAR file is created in the /webcentral-war-root/build folder.
Deploying the WAR file
You deploy the WAR file using application server-specific tools.
Packaging the license file
When you create the WAR file, your development license file (WEB-INF\config\ai-licenses.bin ) is also packaged into the WAR file. If you intend to deploy the WAR file to a production server, you might need to replace the license file in the \WEB-INF\config folder with its production version, before running the WAR build process.
Packaging Java Code into JAR files
If you modify the Java code, and need to deploy the changes to another development or QA server for testing, you do not have to package and redeploy the WAR file – you can just re-deploy the JAR file containing compiled Java code. In the example below, we will use the webcentral-application-space project:
- In Eclipse, open the Gradle Tasks view.
- Select the project node in the Gradle Tasks view.
- Select the webcentral-application-space / build / jar task.
- Right click and select Run Gradle Tasks from the menu.
- Eclipse starts the build and you will see its progress in the Gradle Executions window. It usually takes few minutes to execute the task.
- As a part of the build, Gradle runs all unit tests. If any unit test fails, the build stops.
- The resulting JAR file is created in the /webcentral-application-space/build folder.