I faced the same issue. Sadly I just could update to 3.6.3 via the package manager so I installed it manually. Steps to install on ubuntu below:
Maven 3.3+ requires JDK 1.7 or above to be installed.
Download Apache Maven. I installed 3.8.4, you can check for the newest version here: https://maven.apache.org/download.cgi
We save the archive to /tmp
$ TMP_MAVEN_VERSION=3.8.4
$ wget https://apache.org/dist/maven/maven-3/$TMP_MAVEN_VERSION/binaries/apache-maven-$TMP_MAVEN_VERSION-bin.tar.gz -P /tmp
Then unzip it to /opt
and remove the archive
$ sudo tar xf /tmp/apache-maven-*.tar.gz -C /opt
$ sudo rm /tmp/apache-maven-*-bin.tar.gz
Next we create a sym-link
$ sudo ln -s /opt/apache-maven-$TMP_MAVEN_VERSION /opt/maven
Lastly we set up the env
$ sudo echo "export JAVA_HOME=/usr/lib/jvm/default-java
export M2_HOME=/opt/maven
export MAVEN_HOME=/opt/maven
export PATH=${M2_HOME}/bin:${PATH}" >> /etc/profile.d/maven.sh
To use it without restarting we make it executable and run in
$ sudo chmod +x /etc/profile.d/maven.shsource /etc/profile.d/maven.sh
$ source /etc/profile.d/maven.sh
Now you can verify that it is properly installed
$ mvn -v
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /opt/maven
Java version: 11.0.13, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.11.0-1022-aws", arch: "amd64", family: "unix"
derived by