How Do You Install Maven on Linux?

Problem scenario
How do you install Apache Maven on any distribution of Linux?

Solution
This is based on Apache Maven 3.5.2.*

curl http://mirrors.advancedhosters.com/apache/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz /tmp/apache-maven-3.5.2-bin.tar.gz
sudo tar -xzvf apache-maven-3.5.2-bin.tar.gz
sudo mv apache-maven-3.5.2 /opt/maven
export M2_HOME=/opt/maven
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
source ~/.bashrc
mvn -v

*You can change the directions if you want. You can get the latest installation media from here:
https://maven.apache.org/download.cgi

 » Read more..

How Do You Create a Build Pipeline in Azure?

Problem scenario
You want to use an Azure pipeline. You want it to perform a build. What should you do?

Solution
Prerequisites
i. You must have a supported code versioning system with certain files. As of 10/7/19 the options are Azure Repos Git, Bitbucket Cloud, GitHub, GitHub Enterprise Server, other Git repositories or Subversion. If you follow steps 1 through 4 of How Do You Build a Java Program with Maven?

 » Read more..

How Do You Build a Java Program with Maven?

Problem scenario
You want to use Maven to build a Java program from source code. The code is in at least two different .java files. What do you do?

Solution
Prerequisites
This assumes that you have installed Maven. If you need assistance, see this posting.

Procedures
1. Run this command: mkdir -p src/main/java/contint
2.

 » Read more..

How Do You Troubleshoot the Error “Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact com.sun:tools:jar:1.8.0”?

Problem scenario
You run a Maven command but you get this:

“Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact com.sun:tools:jar:1.8.0 at specified path /usr/lib/jvm/java-8-openjdk-amd64/jre/../lib/tools.jar:

You are running Ubuntu or Debian Linux. What should you do?

Solution
Run this: sudo apt install default-jdk

 » Read more..

How Do You Troubleshoot the Maven Error “Malformed POM…Unrecognised tag: ‘dependency'”?

Problem scenario
You run a Maven (mvn) command. But you receive an error like this:

[INFO] Scanning for projects…
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Malformed POM /home/jdoe/b/gs-maven/initial/src/pom.xml: Unrecognised tag: ‘dependency’ (position: START_TAG seen …\n \n \n … @17:17) @ /home/jdoe/b/gs-maven/initial/src/pom.xml, line 17, column 17
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.springframework:gs-maven:0.1.0 (/home/jdoe/b/gs-maven/initial/src/pom.xml) has 1 error
[ERROR] Malformed POM /home/jdoe/b/gs-maven/initial/src/pom.xml: Unrecognised tag: ‘dependency’ (position: START_TAG seen …\n \n \n … @17:17) @ /home/jdoe/b/gs-maven/initial/src/pom.xml,  » Read more..

How Do You Install Gradle on Any Type of Linux?

Problem scenario
You want to be able to install Gradle on a Debian/Ubuntu Linux server, a Red Hat derivative of Linux (e.g., CentOS/RHEL/Fedora), or Linux SUSE.  How do you do this with the same script?

Prerequisites
i.  Install Java.  If you need directions, see this posting.
ii.  Install unzip. 

  • If you are using Debian or Ubuntu, run this command: sudo apt-get -y install unzip
  • If you are using a Red Hat deriviative (e.g.,

 » Read more..

How Do You Install Maven on Any Type of Linux?

Problem scenario
You want to install Maven with a script.  You want the script to work regardless of what distribution of Linux you are using (e.g., Ubuntu/Debian, RedHat (including CentOS/Fedora), or SUSE).  How do you write a script to install the latest version of Maven?

Solution
Update:  This script was updated on 9/23/19.

1.  Create this file in /tmp/ and call it maven.sh.  Below is the content:

#!/bin/bash
# Written by www.continualintegration.com

mvnversion=3.6.2 # Change this version as necessary

distro=$(cat /etc/*-release | grep NAME)

debflag=$(echo $distro | grep -i “ubuntu”)
if [ -z “$debflag” ]
then # If it is not Ubuntu,  » Read more..

How Do You Know If Maven Has a Plugin for Apache Parquet?

Problem scenario
You have Maven installed.  You want to know if it has the plugin for Apache Parquet from the Linux terminal.  You do not want to use the Maven GUI.  What do you do?

Solution
1.  sudo find / -name pom.xml  
2.  Change to the directory of the pom.xml with Apache Parquet.
3.  Run this command:
mvn help:effective-pom | grep -i parquet

 » Read more..

How Do You Configure Maven to Use an Apache Parquet Plugin?

Problem scenario
You want to use Maven’s Apache Parquet plugin with Hadoop.  How do you use these Apache technologies together?

Solution
1.  Install HDFS.  See this link if you are using Ubuntu.  See this link if you are using a RedHat distribution of Linux. If you have more than one server and want a multi-node cluster of Hadoop, see this link for directions on how to deploy and configure it.

 » Read more..

How Do You Install Maven, openjdk, libssl-dev, build-essential, and pkgconf on a RedHat 7.X or CentOS 6.X Linux Server?

Problem scenario
You are using a RedHat derivative distribution of Linux (e.g., CentOS/RHEL/Fedora).  To eliminate a Hadoop error, you need to install a variety of packages.  How do you install Maven, openjdk, libssl-Dev, build-Essential, and pkgconf?

Solution
To install Maven, see this article.

For the rest of the packages, run these commands: