How include required gradle project into another project

Here I will tell you how to include the required gradle project into another project. Situation may occur when you need to have dependency of another gradle project into your current gradle project, but neither of these projects is a multi-module project. So in this case you can easily add the required project into your current working project. To include another gradle project you need to edit the settings.gradle file of the current project. In the current project’s settings.gradle file, you have to add the project’s name which you want…

Continue

How to exclude Junit tests using Gradle or Maven in Java Applications

Introduction Here in this tutorial I will tell you how to exclude Junit test cases from build automation in Java applications. It’s not about skipping test cases but it’s about excluding test cases for a particular package. Situations may arise when you want to exclude some Junit test cases from running in some environments (for example, uat, prod, etc.) while you are building your Java based application using gradle or maven build tool. For example, you don’t want to run your Junit tests related to Mosquitto or Mqtt in Jenkins…

Continue

How to create executable jar using Gradle or Maven in Spring Boot Application

Introduction In this tutorial I will tell you how to create executable jar using gradle or maven build tool in Spring Boot application. Generally maven or gradle tool is used in Java applications to automate the build process. I will also see how to control the target jar name with version appended into it. Spring Boot provides lots of benefits and one of the benefits is that you can make an executable jar out of web application.

Continue

Create Microservices using Spring Boot and build using Gradle

Introduction Here we will see how to create Microservices using Spring Boot and Spring Cloud and build using Gradle tool. What are Microservices? Before I tell you about the microservices, I would like to tell you about monolithic architectural style, which is built as a single, autonomous unit. So let’s say an web application with client-server model, where the server-side application is a monolith application that handles request/response, executes business logic and work with the data in the underlying database.

Continue

Integrate H2 In-memory Database with Spring Boot 2.1 and build using Gradle

This tutorial will show you how to integrate in-memory H2 database with Spring Boot 2.1 and build using Gradle tool. We will see here simple JPA example to understand how it works. What is an in-memory database? An in memory database is created when an application starts up and destroyed when the application is stopped. Using in memory database has lots of advantages such as:

Continue

Utility classes should not have a public or default constructor – Spring Boot

Introduction The error, utility classes should not have a public or default constructor, you notice mainly in utility classes where you have declared your class method(s) as public static and your class does not have private constructor as well as your class cannot be made as final. This error occurs due to the checkstyle rules defined generally in checkstyle.xml that is used to check the quality of the written Java code. This not only occurs due to the use of checkstyle plugin but also due to the use of SonarQube or…

Continue

How to use checkstyle plugin in gradle based project

Introduction I will show here how to use checkstyle plugin in gradle based Java project. Checkstyle is a static code quality tool used to find Fan-out complexity of a class, complexity of method, utility class, bugs due to not following the coding standards. So you can remove the complexity from your Java source code and make the code more readable and maintainable for future. You may also like to read Code quality using SonarQube or Jacoco in Gradle Projects.

Continue

Building Mule Apps with Gradle in Eclipse

Building Mule Apps with Gradle in Eclipse, i.e., you are going to create Mule project outside Mule Studio. We will build the Mule project in Eclipse using Gradle script. Gradle is becoming more and more popularity as a build system. It combines the power of scripting with the simplicity of conventions, where customization does not end up in tons of messy configurations. Over the times we have done building Mule apps through Mule Studio using Maven plugin. Here you will create build.gradle script with your own hand to build the…

Continue

Integrate npm web app in Spring Boot with Gradle

Integrate npm web app in spring boot with gradle is basically a multi-module project as we have seen in our earlier tutorials here with maven build in spring boot and here with maven in Eclipse. But the example on integrate npm web app in spring boot with gradle uses gradle to build the project. Here we basically create two modules one is frontend or client side called web-app and another one is backend called java-app. Obviously as the name suggests web-app, so it will contain only client side technologies to…

Continue

Creating Kotlin Project in Eclipse

In this tutorial I will show you how to create Kotlin project in Eclipse. This example shows you how to create Kotlin gradle project or Kotlin maven project. Kotlin is statically typed programming language for modern multiplatform applications. Kotlin has 100% compatibility with Java or vice-versa. Salient Features of Kotlin Drastically reduces the amount of boilerplate code. Avoids entire classes of errors such as null pointer exception. Leverages existing libraries for the JVM, Android and the browser. Choose any Java IDE or build from the command line.

Continue