Upload jar file to Artifactory or Nexus repository using Gradle and Maven publish

Sometime we end up with a situation when we have a jar file as dependency of our project and that jar file is not in our artifact repository. This makes difficulties to include this file into our gradle or maven project. Thanks to maven-publish plugin which help us to easily deploy the jar to our private Artifactory or Nexus repository. Here is a sample gradle file to demonstrate that.

Java Selenium web automation example

Selenium Webdriver became a defacto standard for automating the web based test. Here we will see a very basic example of web automation using Selenuium framework. Source code folder structure: java-selenium-web-automation-gradle-example ├──build.gradle ├──settings.gradle └──src └──main └──java └──com └──firstfewlines └──SeleniumSample.java 1. build.gradle group 'com.firstfewlines' version '1.0-SNAPSHOT' apply plugin: 'java' apply plugin: 'application' sourceCompatibility = 1.8 mainClassName = 'com.firstfewlines.SeleniumSample' repositories { mavenCentral() } dependencies { compile('org.seleniumhq.selenium:selenium-java:3.4.0') { exclude group: 'org.

Spring Boot + Spring JPA with PostgreSQL or MySQL or Oracle or SQL Server database and Thymeleaf using Gradle

Here we will see how to build a sample full stack web application using Spring Boot, Spring JPA with database like PostgreSQL, MySQL or Oracle Thymeleaf and Gradle. This example is very similar with my other example regarding Spring boot with H2 database: Spring Boot H2 data source with Thymeleaf using Gradle The only exception here, we will use some production database like postgres as database. So there are changes around Spring JPA configuration and Gradle build file.

Spark Java with Hibernate and MySql database example

In practical scenario it is very common to integrate a database with the web service application. Here we will see an example to use Hibernate to store and retrieve data in Spark Java application. We will use MySql database behind the Hibernate. The application provides HTML based UI for entering and viewing data. Gradle is our build tool here. In case Maven is your favourite build tool, just let me know.

Spring Boot RESTful web service JSON example

Spring Boot comes with all the needed components for creating RESTful web services. Here we will see how easily we can build a simple Spring Boot application which will provide web services for CRUD operations i.e. Create, Retrieve, Update and Delete operations using HTTP POST, GET, PUT and DELETE method respectively. To keep the application simple, we will not use any database. Instead just use a HashMap to store the data objects through a Service layer class.