Posts

Showing posts from June, 2018

Spring Boot RESTful CRUD API Using JPA Data, Hibernate, MySQL.

Image
Spring Boot RESTful CRUD API Using JPA Data, Hibernate, MySQL Project Structure Here is the updated project structure. We will continue with our previous example. Updated Project Structure Add Dependencies First we need to add the following dependencies in our build.gradle file: spring-boot-starter-data-jpa mysql-connector-java spring-boot-starter-data-rest // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa compile ( 'org.springframework.boot:spring-boot-starter-data-jpa' ) // https://mvnrepository.com/artifact/mysql/mysql-connector-java compile group : 'mysql' , name : 'mysql-connector-java' , version : '5.1.6' // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-rest compile group : 'org.springframework.boot' , name : 'spring-boot-starter-data-rest' , version : '1.0.0.RELEASE' Create MySQL Database Here is the scr...

How To Run Spring Boot Web Application On External Tomcat

Image
How To Run Spring Boot Web Application On External Tomcat. By default Spring Boot Web Application is ready for Production/Deployable and runs on Embedded Tomcat Server. If you want to run it on External Tomcat Server Instance, you first need to configure it. In previous post we learned how to create simple hello world spring boot web application . we used our previous spring boot web application in this example. In Development Environment External Tomcat is very handy. So lets start to configure it in Intellij.  Before start anything you just run bootWar Gradle task. It will generate a war file of our project at build/libs/springbootdemo1.war  Note: For simplify war file name remove the version in build.gradle       file. Create a war file using bootWar We will use this war file as an Artifact in External Tomcat. Now click on Edit Run/debug Configuration button and Add New Configuration by clicking on very top left most gree...

Spring Boot v.2.0.2 Release Hello World Example

Image
Spring Boot v.2.0.2 Hello World Example. This is our first simple Spring Boot Hello World example. I am using these following ingredients to build and run this simple Spring Boot Web Application. Intellij Idea 14.1.7 jdk 1.8.0_162 Gradle 4.6 You can use Maven as build tool but I prefer Gradle. So Let's start it. Create a new project using Intellij. Create New Project We create our Project by using Spring Initializr. At this point you can configure Project SDK, here we use 1.8 as shown below. Create New Project using Spring Inializr After clicked on next button, Now setting the Project's basic configuration as show below. Project Basic Settings Now at next screen first select Spring Boot Version (we are using 2.0.2) and also select Spring boot Starter Web Freamwork and Thymeleafe as Templating Engine. Spring Boot Setting   Now named your Spring Boot Project and set its location. Setting Spring Boot Project Name and Location After fi...