3

I'm getting multiple "missing artifact" and "failed to read artifact descriptor" errors on a Spring MVC project, for example:

  • Missing artifact com.google.guava:guava:jar:20.0
  • Failed to read artifact descriptor for com.brooksandrus:swfheader:jar:1.0

I'd like to know:

  • What exactly do they mean
  • How to solve them

What I think of these errors:

  • Also that the fact that I am running the project behind the company's firewall could have something to do with the maven clean install failing with the following error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    Actually, this was one was solved having each required certificate installed in the cacerts file.

What I have already tried:

  • Update Maven Project having Force Update of Snapshots checked.
  • Deleting the entire .m2 folder and then trying a maven update.
  • Followed this SO solution to add the certificates on cacerts file and then rerun the first two steps. This is actually how I solved this error unable to find valid certification path to requested target although it didn't help with the main problem that I mention about the 'Missing artifact' and 'Failed to read artifact descriptor'.

None of these approaches had any effect on the problem.

Another important fact is that besides all these errors, Tomcat launches with success and the project is working properly.

Here is an example part of the pom file.

<?xml version="1.0" encoding="UTF-8"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <groupId>gr.xxxxxx</groupId>
    <artifactId>xxxxxx</artifactId>
    <version>2.2.7</version>
    <packaging>war</packaging>
    <name>xxxxxx</name>
    <description>xxxxxx</description>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spring.version>4.3.23.RELEASE</spring.version>
        <spring.security.version>4.2.12.RELEASE</spring.security.version>
        <hibernate.version>4.1.4.Final</hibernate.version>
        <build.plugins.plugin.version.compiler>3.3</build.plugins.plugin.version.compiler>
        <build.plugins.plugin.version.javadoc>2.10.3</build.plugins.plugin.version.javadoc>
        <junit.version>4.11</junit.version>
        <hamcrest.version>1.3</hamcrest.version>
        <tika.version>1.7</tika.version>
        <mockito.version>1.10.19</mockito.version>
        <doclava.version>1.0.6</doclava.version>
        <adwords.version>4.7.0</adwords.version>
        <hikari.version>3.3.1</hikari.version>
        <mariadb.version>2.4.2</mariadb.version>        
        <thymeleaf.version>3.0.11.RELEASE</thymeleaf.version>
        <stagemonitor.version>0.88.10</stagemonitor.version>
        <javamelody.version>1.79.0</javamelody.version>
        <dynamicreports.version>5.0.0</dynamicreports.version>
        <timestamp>${maven.build.timestamp}</timestamp>
        <maven.build.timestamp.format>dd/MM/yyyy HH:mm</maven.build.timestamp.format>
    </properties>
    <repositories>
        <repository>
            <id>jsqlparser-snapshots</id>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>http://repository.mulesoft.org/releases/</url>
            <layout>default</layout>
        </repository>

Any ideas on how to deal with this are appreciated.

Christos Karapapas
  • 1,018
  • 3
  • 19
  • 40
  • Could you please add an example of your pom ? Thanks. –  Nov 24 '19 at 14:30
  • I don't understand what could be wrong with pom itself? Anyway, I have posted a part of it. – Christos Karapapas Nov 24 '19 at 14:36
  • 1
    Please run `mvn` command with `-X` parameter from command line. You will see more debug log and probably useful errors. – Andriy Budzinskyy Nov 26 '19 at 20:58
  • @AndriyBudzinskyy Great!!! It worked! I ran `mvn clean install -X` I fixed a couple of warnings that were about duplicate declaration of dependencies in `pom.xml` and duplicate declarations of dependencies with conflicting versions, reran `mvn clean install -X` and then finally there was no "Missing artifact" or any other dependency related error in Eclipse! This is finally solved! – Christos Karapapas Nov 26 '19 at 21:33
  • @AndriyBudzinskyy You should probably write an answer for that so that I could pass you as well that bounty points. – Christos Karapapas Nov 26 '19 at 22:33
  • @ChristosKarapapas, added my answer. Thanks. – Andriy Budzinskyy Nov 26 '19 at 22:44

2 Answers2

2

First of all, it's always a good idea to run mvn from command line. It isolates the problem from your IDE and shows logs when maven resolves artifacts.

Also, you can add -X CLI option which produces more debug output and you should see some useful errors:

mvn clean install -X
Andriy Budzinskyy
  • 1,971
  • 22
  • 28
1

I had the same problem at work. My company has different networks. One of which is very strict and as a result I could not download from certain sites, that being from Maven Central. I found a post that was helpful for me: https://stackoverflow.com/a/22594051/7548672

Manually downloading the artifact directly into your .m2 folder is the best approach.

Other options to try:

close your project and reopen it.

Are you behind a proxy?
You can configure the proxy settings in the global or user settings.

Try this? Window -> Preferences -> Maven. Do not automatically update dependencies from remote repositories option, then right-clicking on the project and selecting Maven-> Update Project.

  • Manually downloading of 295 jar files and running equivalent number of commands to install them is not a good idea. If it was just a couple, few or a dozen of them then yes I would it. – Christos Karapapas Nov 24 '19 at 14:29
  • @ChristosKarapapas I missed that part about 295 jar files in your original post. Could you please add an example of what your doing in your pom? This would help others help you. –  Nov 24 '19 at 14:37
  • No, there is no proxy. – Christos Karapapas Nov 24 '19 at 14:54
  • @ChristosKarapapas are you using IntelliJ? –  Nov 24 '19 at 15:08
  • No I'm using Spring Tools for Eclipse 4 – Christos Karapapas Nov 24 '19 at 15:13
  • Considering that you have asked to see the pom and the fact that apparently there was some problem with it, I must say that you gave a good hint, however manually checking a pom of more than a 1000 lines is probably not a good idea, but using mvn clean install -X you can detect much easier any problems. – Christos Karapapas Nov 27 '19 at 04:47