This is practise project to refreshing springboot development using both maven and gradle. We are going to make a simple web based application and setup a basic manually configuration to understand at command line.
- spring-boot-starter-web : uses for web applications
- spring-boot-devtools : it restart the development server on each build change, if you are running your project using command
mvn spring-boot:run
orgradle bootRun
without any IDE, use themvn install
orgradle build
command after each save on another terminal.
- Running the app
mvn spring-boot:run
- Install dependency
mvn clean install
- Check the dependency tree
mvn dependency:tree
- Build standlone jar (it will create in folder
target/{artifactId}.jar
)
mvn package
- Running the standlone app
java -jar {path_to_your_jar_file}
- Environment variable
export MAVEN_OPTS=-Xmx1024m
- create a folder, choose a name.
- create a pom.xml file (ref:file:springboot-ex1-mvn/pom.xml)
- create a javafile MyApplication.java (ref:file:springboot-ex1-mvn/src/main/java/mymvnapp/MyApplication.java)
- run mvn spring-boot:run
- Running app
gradle bootRun
- Check Dependencies
gradle dependencies
- Clean & Install Dependencies
gradle clean build
- Build a standlone jar (build/libs/{name_of_root_folder}.jar)
gradle bootJar
- Run Standlone jar
java -jar {path_to_jar_file}
- Environment Variables
export JAVA_OPTS=-Xmx1024m
- Create a folder
- Make a build.gradle file (ref:./springboot-ex2-gradle/build.gradle)
- Make a MyApplication.java file (ref:./springboot-ex2-gradle/src/main/java/MyApplication.java)
- Run the application using gradle bootRun