In a How To Analyze Java Application With SonarQube post, SonarQube was presented as a major tool for static code analysis. In this post, CI/CD pipeline example will be reviewed. There are a lot of CI/CD tools. Some of the examples are Jenkins, CircleCI, TeamCity, etc. Each of them can be used as a tool to build your CI/CD pipeline. In this article, CircleCI will be used to create a simple pipeline for a Java application.
In order to show the usage of CircleCI, a java application is required. A very simple application with one Java class will be used.
In a How To Check Java Test Coverage With Jacoco post, Jacoco was introduced as a test coverage monitoring tool. In this post, Java SonarQube will be used to apply thousands of automated Static Code Analysis Rules to detect possible problems and technical debt in your code. Quality gates will be used to remain the quality of your code on a reasonable level. Java Sonar can be used in Pull Requests to prevent possible issues on a codebase.
Java SonarQube is used to analyze the source code of the java application. To do it, it should be installed somewhere. For…
In a How To Check Java Source Code With PMD post, PMD was introduced as an option to check the Java source code based on common programming flaws. The next step is to validate the build in accordance with Java Test Coverage. For this purpose, Java Jacoco can be used. In this post, we will see how to add Jacoco to the project. It will be responsible for Java Test Coverage.
In a How To Format Your Java Code With CheckStyle post, CheckStyle was introduced as a first possible step of a static code analysis process in the CI/CD pipeline. The next step is to use a tool to find common programming flaws. For this purpose, Java PMD can be used. In this post, we will see how to add PMD to the project.
Java PMD is a static code analysis tool that is used to find common programming flaws.
Flaws are grouped into different categories:
In a Spring Boot Application Overview Course, a simple spring boot application was created. In this course, we will review some tools that can be useful from the development perspective. Formatting the Java Code with CheckStyle is to be an initial post in the course.
The problem occurs in the fact that multiple developers contribute to the source code. Each of them has individual preferences for code formatting. As a result, the code is inconsistent. Moreover, it brings additional problems. The first developer can write the code in the first style. Then the second developer will apply automatic formatting to…
One of the benefits of Spring is an Inversion of Control (IoC) principle. In Spring objects are managed by Spring IoC container. These objects are called beans. Spring IoC container is responsible for instantiating, configuring, and assembling beans. As a result, a bean has a lifecycle that is managed by Spring. In some cases, bean behavior should be changed. It can be achieved by hooks provided by Spring Framework. In this post, the possible hooks will be reviewed.
Let’s start with Spring Initializr. In this post, we need a Spring Boot project without any dependencies.
After project generation, we will…
In a Spring Boot Application Overview course, a simple Spring Boot application was created. A lot of topics were covered on a high level, however, details were omitted. In order to be productive in the area of Spring applications development, it is necessary to know what is going on underneath. In some cases, Spring Boot Autoconfiguration has to be disabled for some operations, in others — it should be modified in some way. In this post, we will go through the logic behind Spring Boot Autoconfiguration.
org.springframework.boot:spring-boot-autoconfigure jar is responsible for autoconfiguration.
In a previous post, Swagger was used for providing API documentation in Spring Boot Application. In this post, we will introduce Spring Boot Monitoring in the form of Spring Boot Actuator, Prometheus, and Grafana. It allows you to monitor the state of the application based on a predefined set of metrics. Dashboards can help you represent your data in a more meaningful and convenient way.
Let’s start with Spring Boot Actuator. It brings a number of features to monitor and manage the Spring Boot Application. Examples of such features are health, info, and metrics. …
In a previous post, distributed Redis cache was added to Spring Boot Application. In this post, we will introduce API documentation in the form of Swagger. It allows you to review all possible API operations in your Spring Boot Application with a minimum effort. This documentation is helpful when you want to familiarize yourself with an existing API. Also, it is a useful tool when integrating with the front-end team. So, let’s add Swagger to our Spring Boot Application.
It is very easy to add Swagger out-of-the-box features to the Spring Boot Application. We should only add the next dependency:
In a previous post, Spring Boot Application exception handling was introduced. In this article, possible application optimization with Redis cache will be reviewed. There are a lot of possible ways to optimize an application. Hibernate second-level cache, query optimization, or the usage of native SQL (it can be JOOQ) are some of the examples. Also, application architecture can be reviewed which will fully affect the way an application works. In this post distributed Spring Boot cache based on Redis will be implemented. It is one of the simplest ways to achieve optimization.
Not every operation can be cached. Cache bring…