Sending email from your Spring Boot app

1. Overview In this article I’ll show you how you can send email from your spring boot app using JavaMailSender interface. It’s an abstraction for sending emails from spring boot that provides auto configuration and easy implementation. I’m using a gmail account here to demonstrate the process. 2. Depencency Add spring-boot starter-mail dependency on your pom.xml…

Read More

Deploy Spring Boot app on Pivotal Web Service (cloud foundry PaaS)

It’s so much easy to deploy your spring boot app on pivotal web service. You’ve to follow some steps. First add two dependecy on your pom.xml file.

Now package your app using this maven command

Here we passed arguments -Dmaven.test.skip=true  not to test app when packaging. This command will package your app into a jar file. Now…

Read More

Deleting @ManyToMany parent entity without affecting child on Hibernate

Oh Dear!! It’s a nightmare getting MySQLIntegrityConstraintViolationException when you’re designing complex relational database structure for your app. Most of the time hibernate won’t complain with your approximation but this won’t work when it comes to bidirectional relations. Let me show an example. But first consider a scenario that we’re making a movie database application. We have two entities Movie.java and…

Read More

How to deploy Spring boot app as .war file

Hello from ToraCode. If you find your cloud platform doesn’t support container service or deploying standalone application you may find it annoying deploying your app in the cloud. But you can still try creating a traditional .war file to deploy into a container like Tomcat 8, Wildfly 10 or other container. It’s very easy to deploy Spring boot app…

Read More

Deploying sample spring boot app using Docker

Hello from ToraCode. Now that we are set up with Docker virtualisation software. Let’s modify our pom.xml a little bit so that we can build our docker image. We have to add Docker Maven Plugin in our pom.xml file. Inside our <plugins> </plugins> tag we need to add this plugin.

Look a this code. For…

Read More