Here are few of the spring boot,maven and gradle commands I find pretty useful. They are mostly used for building jars and running them.


Package into Jar
$spring jar myapp.jar app.grovy

To see contents of jar
$jar tf my-app.jar

Run Jar
$java -jar myapp.jar

 
Building with Gradle
$ gradle build

Refer to this link https://docs.spring.io/spring-boot/docs/2.0.2.RELEASE/gradle-plugin/reference/html/


Then run the jar with
$java -jar myapp.jar

OR
Run with gradle
$gradle run

 
Using Maven to build Jar
$mvn clean package

Either run the jar directly(same as above) or use Maven
$mvn springboot:run

Refer link here https://maven.apache.org/install.html

 
Categories: JavaTutorial

0 Comments

What do you think?