Home > OS >  One of the 2 eclipse instances on my PC gives: Failed to read artifact descriptor for com.google.gua
One of the 2 eclipse instances on my PC gives: Failed to read artifact descriptor for com.google.gua

Time:12-26

I have 2 eclipse instances. The same POM dependency causes this error in one of the eclipse instances:

    org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.google.guava:guava:jar:31.1.0.redhat-00001
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:329)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:198)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:535)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:519)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:409)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:504)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:504)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:254)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:316)
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:172)
    at org.apache.maven.project.DefaultProjectBuilder.resolveDependencies(DefaultProjectBuilder.java:215)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:188)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:119)
    at org.eclipse.m2e.core.internal.embedder.MavenImpl.readMavenProject(MavenImpl.java:636)
    at org.eclipse.m2e.core.internal.project.registry.DefaultMavenDependencyResolver.resolveProjectDependencies(DefaultMavenDependencyResolver.java:63)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refreshPhase2(ProjectRegistryManager.java:530)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager$3.call(ProjectRegistryManager.java:492)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager$3.call(ProjectRegistryManager.java:1)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:496)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:351)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:298)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.getProjectFacade(MavenBuilder.java:154)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:89)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Failure to find com.google.guava:guava-parent:pom:31.1.0.redhat-00001 in https://nexus.akbankpreprod.com/repository/maven-public-int/ was cached in the local repository, resolution will not be reattempted until the update interval of maven-public-int has elapsed or updates are forced
    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:177)
    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:226)
    at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1000)
    at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:800)
    at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:329)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:320)
    ... 49 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find com.google.guava:guava-parent:pom:31.1.0.redhat-00001 in https://nexus.akbankpreprod.com/repository/maven-public-int/ was cached in the local repository, resolution will not be reattempted until the update interval of maven-public-int has elapsed or updates are forced
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
    at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:173)
    ... 54 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find com.google.guava:guava-parent:pom:31.1.0.redhat-00001 in https://nexus.akbankpreprod.com/repository/maven-public-int/ was cached in the local repository, resolution will not be reattempted until the update interval of maven-public-int has elapsed or updates are forced
    at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:231)
    at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:585)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:503)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
    ... 57 more
    pom.xml /ContractTestingFaturaProvider  line 1  Maven Dependency Problem

Here is the dependency causing the error on one eclipse instance but working good on the other:

    <dependency>
      <groupId>au.com.dius</groupId>
      <artifactId>pact-jvm-provider-spring_2.12</artifactId>
      <version>3.5.24</version>
      <scope>test</scope>
    </dependency>

The problematic eclipse instance uses Nexus and has a maven project with this POM:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ctfaturaprovider</groupId>
<artifactId>contract-testing-fatura-provider</artifactId>
<version>0.0.1-SNAPSHOT</version>

<!-- Kontrat testing ile ilgili parent: --> 
<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.1.RELEASE</version>
        <relativePath /> 
</parent>
<build>
    <finalName>BSA_ctfaturaprovider_ContractTestingFaturaProvider</finalName>
    <sourceDirectory>src</sourceDirectory>
    <testSourceDirectory>test</testSourceDirectory>
    <resources>
        <resource>
            <directory>src</directory>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.5.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
                <execution>
                    <id>report</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <version>2.5</version>
            <executions>
                <execution>
                    <id>update_bsa_versions</id>
                    <phase>validate</phase>
                    <goals>
                        <goal>use-latest-snapshots</goal>
                    </goals>
                    <inherited>false</inherited>
                    <configuration>
                        <includes>com.akbank.*:*</includes>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

<distributionManagement>
    <snapshotRepository>
        <id>akbank-maven-snapshots</id>
        <name>akbank-maven-snapshots</name>
        <url>${akbank-maven-snapshots.url}</url>
    </snapshotRepository>

    <repository>
        <id>akbank-maven-releases</id>
        <name>akbank-maven-releases</name>
        <url>${akbank-maven-releases.url}</url>
    </repository>
</distributionManagement>

<dependencies>
    <!-- Kontrat testing ile ilgili dependency'ler: -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>


    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
            
    <!-- https://mvnrepository.com/artifact/au.com.dius.pact.provider/junit -->
    <dependency>
      <groupId>au.com.dius</groupId>
      <artifactId>pact-jvm-provider-spring_2.12</artifactId>
      <version>3.5.24</version>
      <scope>test</scope>
    </dependency>
    <!-- Kontrat testing ile ilgili dependency'ler sonu -->
    
    <dependency>
        <groupId>com.akbank.bsa</groupId>
        <artifactId>bsa-core</artifactId>
        <version>0.1.2-SNAPSHOT</version>
        <scope>provided</scope>
        <exclusions>
            <exclusion>
                <groupId>xerces</groupId>
                <artifactId>xercesImpl</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.akbank.bsa</groupId>
        <artifactId>bsa-unittest</artifactId>
        <version>1.0.2-SNAPSHOT</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
</project>

The other eclipse does not use Nexus and has a building maven project with this POM:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>cagingroup</groupId>
  <artifactId>FaturaOdemeProvider</artifactId>
  <version>0.0.1-SNAPSHOT</version>
    <!-- Kontrat testing ile ilgili parent: -->
    <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>1.4.1.RELEASE</version>
            <relativePath /> 
    </parent>
    <dependencies>
        <!-- Kontrat testing ile ilgili dependency'ler: -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>


        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
                
        <!-- https://mvnrepository.com/artifact/au.com.dius.pact.provider/junit -->
        <dependency>
          <groupId>au.com.dius</groupId>
          <artifactId>pact-jvm-provider-spring_2.12</artifactId>
          <version>3.5.24</version>
          <scope>test</scope>
        </dependency>
        <!-- Kontrat testing ile ilgili dependency'ler sonu -->
    </dependencies>
</project>

Isn't the dependency jar supposed to be on my local m2? When I check C:\Users\57046.m2\repository\com\google\guava\guava\31.1.0.redhat-00001 I don't see any jar. How on earth does the non-problematic eclipse find this jar then?

This error in the build output tells me that the JBoss dependency in the problematic eclipse instance references the guava version not found:

[ERROR] Failed to execute goal on project contract-testing-fatura-provider: Could not resolve dependencies for project ctfaturaprovider:contract-testing-fatura-provider:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at au.com.dius:pact-jvm-provider-spring_2.12:jar:3.5.24 -> au.com.dius:pact-jvm-provider-junit_2.12:jar:3.5.24 -> com.github.rholder:guava-retrying:jar:2.0.0 -> com.google.guava:guava:jar:31.1.0.redhat-00001: Failed to read artifact descriptor for com.google.guava:guava:jar:31.1.0.redhat-00001: Could not find artifact com.google.guava:guava-parent:pom:31.1.0.redhat-00001 in maven-public (https://nexus.akbankpreprod.com/repository/maven-public/)

As per @howlger's comment, I'll attach the classpath files, they look so different. Here is the one which is working ok:

    <?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" output="target/classes" path="src/main/java">
        <attributes>
            <attribute name="optional" value="true"/>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="src" output="target/test-classes" path="src/test/java">
        <attributes>
            <attribute name="test" value="true"/>
            <attribute name="optional" value="true"/>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
        <attributes>
            <attribute name="test" value="true"/>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk-11.0.16.1">
        <attributes>
            <attribute name="module" value="true"/>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="output" path="target/classes"/>
</classpath>

And the classpath in the problematic eclipse:

    <?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry including="**/*.java" kind="src" output="target/classes" path="src">
        <attributes>
            <attribute name="optional" value="true"/>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="src" output="target/test-classes" path="test">
        <attributes>
            <attribute name="optional" value="true"/>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
            <attribute name="org.eclipse.jst.component.nondependency" value=""/>
        </attributes>
    </classpathentry>
    <classpathentry kind="output" path="target/classes"/>
</classpath>

I'm totaly stuck here. My Nexus guy couldn't solve the problem yet. Other guy responsible for the problematic eclipse says this is an issue with Nexus setup. Any help would be highly apprreciated! I'm getting a bit too emotional here :D

CodePudding user response:

Problem was solved by adding an exclusion for the problematic dependency:

<dependency>
      <groupId>au.com.dius</groupId>
      <artifactId>pact-jvm-provider-spring_2.12</artifactId>
      <version>3.5.24</version>
      <scope>test</scope>
        <exclusions>
          <exclusion>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                  <version>31.1.0.redhat-00001</version>
            </exclusion>
        </exclusions>
    </dependency>

My nexus guy says that the JBoss setup in the problematic eclipse version requires this Guava dependency and loads it before pact-jvm-provide-spring does. This guava version has problems, its jar is missing. But somehow it is selected by Maven. The other Eclipse instance does not have JBoss and another version of Guava is selected by Maven.

Maybe we have hit a Maven bug here: A dependency without jar file is being selected. Here is the POM which causes Maven to select this version of Guava:

<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
  <version>[10. ,)</version>
  <scope>compile</scope>
</dependency>

So it is asking for a 10. version of Guava and Maven picks the one without a jar file.

  • Related