Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 1008 Bytes

build_an_executable_jar_with_both.adoc

File metadata and controls

21 lines (16 loc) · 1008 Bytes

You can run the application from the command line with Gradle or Maven. You can also build a single executable JAR file that contains all the necessary dependencies, classes, and resources and run that. Building an executable jar makes it easy to ship, version, and deploy the service as an application throughout the development lifecycle, across different environments, and so forth.

If you use Gradle, you can run the application by using ./gradlew bootRun. Alternatively, you can build the JAR file by using ./gradlew build and then run the JAR file, as follows:

java -jar build/libs/{project_id}-0.0.1-SNAPSHOT.jar

If you use Maven, you can run the application by using ./mvnw spring-boot:run. Alternatively, you can build the JAR file with ./mvnw clean package and then run the JAR file, as follows:

java -jar target/{project_id}-0.0.1-SNAPSHOT.jar