Posts

Showing posts with the label maven

Maven - Manual installation on Linux or MacOS

This article explains the steps to manually install a specific version of maven downloaded directly from maven website or internal artificatory of an organisation. Create a directory for installation: mkdir -p $HOME/tools/maven Download the binary: From https://maven.apache.org/download.cgi download latest static binary eg: apache-maven-3.9.11-bin.tar.gz to $HOME/tools/maven directory Extract and rename the binary: find $HOME/tools/maven -type f -name apache-maven-*.tar.gz | xargs -I {} mv {} $HOME/tools/maven/apache-maven-bin.tar.gz tar -xvzf $HOME/tools/maven/apache-maven-bin.tar.gz -C $HOME/tools/maven find $HOME/tools/maven -type d -name apache-maven-* | xargs -I {} mv {} $HOME/tools/maven/apache-maven Make files executable: chmod a+rwx -R $HOME/tools/maven/* Identify the shell type: echo $SHELL Configure PATH: Add the following lines to $HOME/.bash_profile or $HOME/.bashrc  or  $HOME/.zprofile  and restart system for the changes to take effect export MAVEN_HOME=$...

Headless Web Driver testing with Chrome on Headless Servers

Recently, I had a task to migrate the WebDriver based test cases from PhantomJs to Chrome headless and the tests were running on headless CI docker containers. The migration was not a smooth journey as I had anticipated and this article is based on my learning experience during this migration. PhantomJs was widely used for headless testing and now it has been unofficially abandoned by the PhantomJs team. So we had to switch to some other browser which is under active development and also which supports headless mode. The choice was Google Chrome (or Chromium). As more and more organizations move towards cloud containers or virtual machines to run their CI build, it is quite important to have the ability to run your WebDriver based tests in headless mode. My key learnings from this migration: Avoid using Xvfb (Virtual Frame Buffer) as virtual display when your test suite has hundreds of test cases.  Xvfb crashes in the middle of the test for unknown reason and Chrome fail...

Install a specific version of a package in Debian / Ubuntu

Quiet often we setup auto pipelines for Continuous Integration in Cloud (like GitLab CI, Travis CI etc) and we install required packages (like mvn or gradle) using apt-get install  command to run the build. Sometimes it is quiet important to have a specific major version of a package or major-minor version of a package to run the build, otherwise the build might break with unintended behaviour. Hence this post explains the following commands on Debian / Ubuntu operating system: List all available packages Search for a package List the available version of a package Install a specific version of a package Install a specific major version of a package Install a specific major.minor version of a package Install a specific major.minor.security version of a package List all available packages apt-cache pkgnames Search for a package apt-cache search jdk List the available version of a package apt-cache madison maven Install a specific version of a package ...