I’m trying to run an Open Liberty server on Ubuntu 18.04, but getting the following error when when executing mvn liberty:dev
:
Failed to execute goal io.openliberty.tools:liberty-maven-plugin:3.7.1:dev (default-
cli) on project hello-world: org.apache.maven.plugin.MojoExecutionException: Unable
to resolve artifact: io.openliberty.features:io.openliberty.jakarta.persistence.base-
3.1:23.0.0.3: Failure to find
io.openliberty.features:io.openliberty.jakarta.persistence.base-3.1:esa:23.0.0.3 in
https://repo.maven.apache.org/maven2 was cached in the local repository, resolution
will not be reattempted until the update interval of central has elapsed or updates
are forced -> [Help 1]
What I have installed:
$ java --version
openjdk 11.0.18 2023-01-17
OpenJDK Runtime Environment (build 11.0.18+10-post-Ubuntu-0ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.18+10-post-Ubuntu-0ubuntu118.04.1, mixed mode,
sharing)
$ mvn -v
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 11.0.18, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: cs_CZ, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-146-generic", arch: "amd64", family: "unix"
I was able to start the server just fine yesterday and I have no recollection of changing anything since then. Can’t figure out how to fix this and would appreciate some help.
3
Answers
The error message suggests that Maven was unable to resolve the dependency for the io.openliberty.jakarta.persistence.base-3.1 artifact. This could be due to a number of reasons, such as a network connectivity issue, a problem with the remote repository, or a problem with the local repository.
Here are some steps you can try to resolve this issue:
Check your network connectivity: Ensure that you have an active internet connection and that your firewall settings are not blocking the connection to the remote repository.
Force an update of the central repository: You can try forcing an update of the central repository by running the following command:
mvn dependency:purge-local-repository clean install -U
This command will delete the local repository and force Maven to download all dependencies again.
Check the remote repository: Check if the remote repository is available and if the io.openliberty.jakarta.persistence.base-3.1 artifact exists. You can try accessing the repository URL directly in your web browser to see if it is accessible.
Check the local repository: Check if the io.openliberty.jakarta.persistence.base-3.1 artifact exists in your local repository. The local repository is located in the .m2 directory in your home directory. You can try deleting the io directory from the .m2/repository/io directory and then running mvn liberty:dev again.
If none of these steps work, you can try updating the version of the io.openliberty.jakarta.persistence.base-3.1 artifact to a different version or try adding a different repository to your pom.xml file.
I hope this helps!
The 23.0.0.3 version is in the process of getting published today and most likely all the pieces are not in Maven Central yet. I would suggest trying version 23.0.0.2 in the meantime, and try again later today or tomorrow with 23.0.0.3.
As for what changed, the Liberty Maven plugin automatically downloads the latest OpenLiberty release unless configured otherwise. So today it is trying to download 23.0.0.3, and yesterday it was using 23.0.0.2.
I’m always configuring plugin for the specific version, as I want to have consistent builds/behavior. Just add the following to your
pom.xml
file (theconfiguration
section). In this case I wanted to have 22.0.0.12 and also themicroProfile5
bundle to avoid unnecessary downloads of features I wont need: