wix-incubator / exodus

Easily migrate your JVM code from Maven to Bazel
MIT License
222 stars 21 forks source link

Failing to read artifact descriptor #64

Open cdickson-sum opened 3 years ago

cdickson-sum commented 3 years ago

I am getting the following failure message, and I am not sure what its trying tell me.

Closure request failed: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.sun.xml.bind:jaxb-osgi:jar:2.2.10

I have looked in the local .m2 repository, and there is a POM file etc. Any hint as to why this may be failing?

natansil commented 3 years ago

@or-shachar what is the mitigation here?

cdickson-sum commented 3 years ago

Sorry, just filled in the command line as per the doc. This is happening right out of the gate. Are you asking for the command line? The item failing is not a direct dependency. I am unsure where its coming from, but probably Spring or Spring Boot. So it's in the managed deps someplace.

`Exception in thread "main" com.wixpress.build.maven.DependencyResolverException: Could not get closure of com.mycompany:testjar:1.0.4-SNAPSHOT Closure request failed: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.sun.xml.bind:jaxb-osgi:jar:2.2.10 Direct deps (28):

Thank you for your help!

or-shachar commented 3 years ago

Hey @cdickson-sum - any chance to get a repro? Public repo with 1 module, dummy java file and pom.xml that asks for com.sun.xml.bind:jaxb-osgi:jar:2.2.10

robertgates55 commented 3 years ago

I've got a similar issue on a big multimodule project (also failing to read the descriptor for a jaxb 2.2 artifact) - and I'm also struggling to unpick things.

com.wixpress.build.maven.DependencyResolverException: Closure request failed: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.sun.xml.bind:jaxb-core:jar:2.2.11
    Direct deps (164):
     -  com.univocity:univocity-parsers:2.9.1
     -  org.jmock:jmock-junit4:2.12.0
     -  org.jmock:jmock-legacy:2.12.0
     -  ...

My questions:

That version of the artifact is not being requested in any of my poms (we've got multiple refs to 2.3.0.1), so it must be transitive... but it's hard to unpick which.

robertgates55 commented 3 years ago

I've just made a super simple repro 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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>co.du</groupId>
  <artifactId>exodus-issue</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>exodus-issue</name>
  <dependencies>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-core</artifactId>
      <version>2.2.11</version>
    </dependency>
  </dependencies>
</project>

Repro with:

git clone https://github.com/robertgates55/exodus-repro-repo
cd exodus-repro-repo
REPO_ROOT=$(pwd)
mvn clean install
java -Xmx12G -Dskip.classpath=false -Dskip.transformation=false -Dlocal.maven.repository.path="${HOME}/.m2/repository" -Dfail.on.severe.conflicts=false -Drepo.root="${REPO_ROOT}" -Drepo.url=git@github.com:robertgates55/exodus-repro-repo.git -jar ~/Downloads/exodus.jar

Which throws:

 _____              _
|  ___|            | |
| |____  _____   __| |_   _ ___
|  __\ \/ / _ \ / _` | | | / __|    by Wix
| |___>  < (_) | (_| | |_| \__ \
\____/_/\_\___/ \__,_|\__,_|___/    with <3

starting migration with configuration [RunConfiguration(/Users/robgates/exodus-repro-repo,git@github.com:robertgates55/exodus-repro-repo.git,None,None,true,true,true,false,false,List(https://repo.maven.apache.org/maven2/, https://maven-central.storage.googleapis.com),None,None,None,false,Some(/Users/robgates/.m2/repository),None,None,true,false)]
20:22:54.842 INFO  class=[log]  Logging to Logger[org.mortbay.log] via org.mortbay.log.Slf4jLog
20:22:54.874 INFO  class=[log]  jetty-6.1.x
20:22:54.911 INFO  class=[log]  Started SocketConnector@0.0.0.0:57850
20:22:56.012 WARN  class=[WarnChecksumPolicy]  Could not validate integrity of download from http://localhost:57850/co/du/exodus-issue/1.0-SNAPSHOT/exodus-issue-1.0-SNAPSHOT.pom: Checksum validation failed, no checksums available
Exception in thread "main" com.wixpress.build.maven.DependencyResolverException: Could not get closure of co.du:exodus-issue:1.0-SNAPSHOT
Closure request failed: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.sun.xml.bind:jaxb-core:jar:2.2.11
        Direct deps (1):
         -      com.sun.xml.bind:jaxb-core:2.2.11

        Managed deps (0):

        at com.wixpress.build.maven.MavenDependencyResolver.allDependenciesOf(MavenDependencyResolver.scala:16)
        at com.wixpress.build.maven.MavenDependencyResolver.allDependenciesOf$(MavenDependencyResolver.scala:13)
        at com.wixpress.build.maven.AetherMavenDependencyResolver.allDependenciesOf(AetherMavenDependencyResolver.scala:27)
        at com.wix.build.maven.analysis.MavenBuildSystem.withAllModuleDependencies(MavenBuildSystem.scala:26)
        at com.wix.build.maven.analysis.MavenBuildSystem.$anonfun$modules$2(MavenBuildSystem.scala:20)
        at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:233)
        at scala.collection.immutable.Set$Set1.foreach(Set.scala:95)
        at scala.collection.TraversableLike.map(TraversableLike.scala:233)
        at scala.collection.TraversableLike.map$(TraversableLike.scala:226)
        at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
        at scala.collection.SetLike.map(SetLike.scala:100)
        at scala.collection.SetLike.map$(SetLike.scala:100)
        at scala.collection.AbstractSet.map(Set.scala:47)
        at com.wix.build.maven.analysis.MavenBuildSystem.modules(MavenBuildSystem.scala:20)
        at com.wix.build.maven.analysis.SourceModules$.apply(SourceModules.scala:15)
        at com.wix.build.maven.analysis.SourceModules$.of(SourceModules.scala:18)
        at com.wix.bazel.migrator.app.MigratorInputs.readSourceModules(MigratorInputs.scala:79)
        at com.wix.bazel.migrator.app.MigratorInputs.sourceModules$lzycompute(MigratorInputs.scala:32)
        at com.wix.bazel.migrator.app.MigratorInputs.sourceModules(MigratorInputs.scala:32)
        at com.wix.bazel.migrator.app.MigratorInputs.codeModules$lzycompute(MigratorInputs.scala:33)
        at com.wix.bazel.migrator.app.MigratorInputs.codeModules(MigratorInputs.scala:33)
        at com.wix.bazel.migrator.app.MigratorInputs.collectExternalDependenciesUsedByRepoModules(MigratorInputs.scala:89)
        at com.wix.bazel.migrator.app.MigratorInputs.directDependencies$lzycompute(MigratorInputs.scala:34)
        at com.wix.bazel.migrator.app.MigratorInputs.directDependencies(MigratorInputs.scala:34)
        at com.wix.bazel.migrator.app.MigratorInputs.dependencyCollector(MigratorInputs.scala:94)
        at com.wix.bazel.migrator.app.MigratorInputs.<init>(MigratorInputs.scala:35)
        at com.wix.bazel.migrator.app.Migrator.<init>(Migrator.scala:22)
        at com.wix.bazel.migrator.app.PublicMigrator.<init>(Migrator.scala:168)
        at com.wix.bazel.migrator.app.MigratorApplication$.migrate(MigratorApplication.scala:18)
        at com.wix.bazel.migrator.app.MigratorApplication$.delayedEndpoint$com$wix$bazel$migrator$app$MigratorApplication$1(MigratorApplication.scala:14)
        at com.wix.bazel.migrator.app.MigratorApplication$delayedInit$body.apply(MigratorApplication.scala:13)
        at scala.Function0.apply$mcV$sp(Function0.scala:34)
        at scala.Function0.apply$mcV$sp$(Function0.scala:34)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
        at scala.App.$anonfun$main$1$adapted(App.scala:76)
        at scala.collection.immutable.List.foreach(List.scala:388)
        at scala.App.main(App.scala:76)
        at scala.App.main$(App.scala:74)
        at com.wix.bazel.migrator.app.MigratorApplication$.main(MigratorApplication.scala:13)
        at com.wix.bazel.migrator.app.MigratorApplication.main(MigratorApplication.scala)
robertgates55 commented 3 years ago

Confirmed that the above happens with JDK11, but works with JDK8

natansil commented 3 years ago

@or-shachar maybe an upgrade to maven resolver lib can address this.