Sunday, March 18, 2018

Forking and maintaining a git repository

There are many public repositories which at times we want to fork and continue our path. However, at the same time, we want to keep pulling the changes from the original repository also. In this post, we will look into how to fork a repository and how to pull the changes in future.

Forking

Let's say we want to fork a repository 

Application versioning with Git and Gradle

Please follow Rest API Server to see the big picture and GitHub repo details.

Application versioning in Git is tricky compared to subversion. Subversion commits are in the increasing order of number so it's easy to put them as part of the application version. Being numbers they are easy to comprehend. However, Git commit id's are hash which would frighten any faint-hearted. A typical git commit id may look like

Sunday, March 4, 2018

Apache Tika Tutorial

Apache Tika is a powerful library to detect and extract text and metadata from thousands of file formats. This is very useful when you are more interested in the content of the file and building your logic on top of it.

Let's see a simple code in terms of how to use Tika

Tuesday, February 27, 2018

Hibernate Envers

Please follow Rest API Server to see the big picture and GitHub repo details.

Hibernate Envers helps in creating an audit trail of the records in the database. Hibernate Envers audits all the attribute changes in an audit table. To enable the support for Hibernate Envers, add the dependency

    compile('org.hibernate:hibernate-envers')

Add the appropriate version. If you are using Spring boot dependency management then the version will be automatically taken care by Spring boot.

Paging and Sorting using Spring Boot

Picture Credit : Pixabay


Please follow Rest API Server to see the big picture and GitHub repo details.

Paging and Sorting is an important use case for any application. Any web or mobile frontend, a listing will usually need such a capability.

To support Paging and sorting in a Spring boot application, we need to do the following.

The Spring data repository interface

Sunday, February 25, 2018

Liquibase Tutorial

Photo credit: Pixabay.com


Please follow Rest API Server to see the big picture and GitHub repo details.

Liquibase helps in database schema management. The schema can be defined in XML, YAML, JSON and SQL format. It supports multiple databases. Also, the evolution of the database can be managed through liquibase using the concept of changesets.

In build.gradle add

  compile('org.liquibase:liquibase-core')

In application.properties add

Saturday, February 17, 2018

Swagger 2 Support for Rest API Documentation

Please follow Rest API Server to see the big picture and GitHub repo details.

Swagger 2 helps in building the documentation for Rest API's. Springfox provides a suite of libraries to support this. To support, Rest API documentation in Spring boot, follow the steps below

Add to Gradle dependencies

compile('io.springfox:springfox-swagger2:2.7.0')
compile('io.springfox:springfox-swagger-ui:2.7.0')

The Swagger dependency helps in documenting the Rest API. The second dependency helps in providing a UI to present the set of API's on browser.

Now define the configuration bean