Posts

Showing posts from January, 2022

Maven Wrapper - Need, Installation and Benefits

Maven is a build management system. The Maven wrapper can be used to install the right version of Maven. In this article, we will be learning about the wrapper and its benefits. Need for Maven Wrapper Normally, applications require specific Maven versions for the application to run successfully. So, developers need to ensure that the right Maven version is installed and available on the path. The Maven wrapper solves this issue. Using the wrapper, you just need to specify the desired Maven version. The wrapper then automatically installs the specified Maven version and makes it available on the path. Wrapper Installation Steps Let us first learn about the steps to install the wrapper. Open a command prompt/terminal window and navigate to the directory where you want to install the wrapper Run the following command: mvn -N io.takari:maven:wrapper 3. This command installs files related to the wrapper. So, you will see the following files/folders: .mvnw – This folder contains wrapper-spec

Git commands CheatSheet - List of most used Git commands

In this article, I will be listing some of the important Git commands along with their syntax and examples. This article is aimed to be a Git commands cheatsheet for developers. Important Git Commands git init The git init command creates a local repository.  It creates a hidden .git folder that represents the local repository . Syntax git init Examples git init      # Initializes the current directory as a git repository git init <path> # Initializes the specified directory as a git repository git add The git add command adds files to the git staging area Syntax git add <filename> Examples git add Hello.java # adds Hello.java git add . # adds everything from the current directory recursively OR git add -A # same as git add . git commit The git commit command adds files to the local repository . You can use it to add a single file as well as a bunch of files. Syntax git commit -m "<msg>" Examples git commit -m "Initial commit" git commit -am "

How to Create a Remote Github repository

Image
In this article, I will be listing down a few basic instructions to create a remote repository in git. Creating a remote Git repository is a two-step process. First, you need to create a remote repository on your Git hosting system (Github) and then you can push your local changes to it. Let us now take a look at these steps. Creating a repository on Github Step 1: Go to Github.com. Sign in/Sign up Step 2: Click on the “+” sign in the top right and click New Repository: Step 3: In the new repository page, enter the name ( github-demo ). Click on the checkbox to “ Add a Readme ” file. Add a description if required. Click on “Create Repository” : This creates a repository as follows:   Create a Local Repository The next step is to create a local git repository. For this, you need to follow the steps given below. Step 4: Open a command prompt/terminal window/git bash prompt Step 5: Clone the newly created repository by running the following command (Replace <githubusername> with yo

TestNG Annotations Explained In Detail

In this article, I will be explaining some of the important TestNG annotations. Introduction TestNG is a popular unit testing framework. It allows creating and running tests. Though largely inspired by JUNIT, it has many advanced features like generating HTML reports, running parametrized tests, and so on. One of the key features of TestNG is its ability to be configured via annotations. Annotations can be embedded within the TestNG code and help to control the flow of test execution. TestNG Annotations Let us now take a closer look at the TestNG annotations. @Test Designates a method as a TestNG test. Thus, you need to specify this annotation on any method that you want to run as a TestNG test. The @Test annotation has several attributes. Some of these are as follows: group: Specifies the group that the test belongs to. (TestNG allows creating test groups, so you can group related tests and run them in one go) description: Specifies the test description enabled: Specifies whether tes