[ERROR] Error executing Maven. [ERROR] java.lang.IllegalStateException: Unable to load cache item
Published in
May 14, 2022
on ubuntu 18.04, the latest maven version from apt is still Apache Maven 3.6.0, which doesn’t support jdk17, and we will get the above titled error when executing mvn install.
to fix this, we need to manually download and install apache-maven-3.8.5.
cd /tmp
wget https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.tar.gz
tar xvf apache-maven-3.8.5-bin.tar.gzcd /usr/share/maven
sudo cp /tmp/apache-maven-3.8.5/* .
now we have
$ mvn -version
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /usr/share/maven
Java version: 17.0.3, vendor: Private Build, runtime: /usr/lib/jvm/java-17-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-1072-aws", arch: "amd64", family: "unix"
verify
git clone https://github.com/WebGoat/WebGoat/
cd WebGoat/
mvn clean install -DskipTests[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.203 s
[INFO] Finished at: 2022-05-14T01:56:47Z
[INFO] ------------------------------------------------------------------------