Gradle Settings
Your server-side project can be found in the serverside
folder in the root of your target repository.
SpringBot writes the spring server-side as a Gradle application. Gradle is a build tool that can handle running, building, testing, and even packaging your application for deploy. It also handles dependencies and can run custom tasks.
Let’s take a look at the Gradle files in the root directory of serverside
serverside/gradle.properties
contains version numbers. The only one we will be editing for target applications is version in it’s protected region:
# % protected region % [Update the version of your application here] on begin
version=0.1.4.1
# % protected region % [Update the version of your application here] end
Make sure you turn this protected region
on
, as the version will otherwise be removed next time the bot writes the code
You can change this version as you please. When you run ./gradlew bootJar
or ./gradlew bootWar
it will create a jar or war in the serverside/build/libs
folder with the name ${rootProject.name}-${version}.
war or jar
serverside/settings.gradle
contains the project name setting which is used for the Gradle tasks - many of which can be found in the
serverside/build.gradle
file. This file contains dependencies, tasks, eternal repositories, and custom tasks. If you want to add a dependency to your spring server-side, you can simply add it as a Gradle dependency.
Find the bottom of the dependencies object in the build.gradle file:
...
// Process annotations
annotationProcessor 'org.projectlombok:lombok:1.18.4'
annotationProcessor 'com.querydsl:querydsl-apt:4.2.1:jpa'
annotationProcessor 'org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final'
annotationProcessor 'javax.annotation:javax.annotation-api:1.3.2'
// % protected region % [Apply any additional dependencies here] off begin
// % protected region % [Apply any additional dependencies here] end
}
Was this article helpful?