Official Content

Spring Boot is an extension of the Spring Framework project, which simplifies the configuration and development of Java applications. It provides a set of predefined standards and default settings to speed up development.
 
The main difference when using Spring Boot on a Knowledge Base with the Java environment is that you don't need to have Tomcat installed to Build your KB. This is because Spring Boot comes with an embedded Tomcat server.
 
In addition to this advantage, Spring Boot offers other benefits in GeneXus, such as:
  • Accelerated prototyping, which allows creating Java applications quickly and easily.
  • Automatic download and configuration of Spring Boot by setting Spring Boot in the Java Framework property and selecting "Rebuild All". 
  • Unlike Tomcat, which generates a folder structure in the "webapps" directory, Spring Boot generates a single JAR file called "web.jar" in "build\libs", which contains your application ready to run. 

Steps to Build your KB with Spring Boot

Follow the steps below to Build your KB using Spring Boot:
  1. Make sure you have JDK 17 or higher installed.
  2. Go to Preferences and check that the current environment is Java.
  3. Configure the JDK Directory (JAVA HOME) property with the path where the JDK is installed.
  4. Set the value Spring Boot in the Java Framework property and select "Rebuild All". GeneXus detects that you have selected Spring Boot as the framework and automatically downloads and configures Spring Boot.
    If the server is not previously active, GeneXus will start it automatically after compilation or before running the application.
  5. Press F5 or select Build > Run Developer Menu. Also, it is possible to run from the command line, using:
    java.exe -jar web.jar
Note that Spring Boot uses the same default port as Tomcat (port 8080). Therefore, if you decide to use Spring Boot, make sure to disable all Tomcat servers on the machine. This will avoid port conflicts so that the application runs smoothly with Spring Boot. 

Availability

This functionality is available as Beta since GeneXus 18 Upgrade 6

   

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant