Re: [MDEP-644] Tests failing due to Guice Plexus incompatability

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [MDEP-644] Tests failing due to Guice Plexus incompatability

Tomo Suzuki
I'm afraid that I'm not familiar with the error. "Type
org.eclipse.aether.DefaultRepositorySystem not present" is suspicious but I
see you added maven-resolver-impl dependency. Pasting the error message
below in case if other folks may know the solution

[ERROR]
testCopyStripClassifierSetInMojo(org.apache.maven.plugins.dependency.fromConfiguration.TestCopyMojo)
 Time elapsed: 0.225 s  <<< ERROR!
org.apache.maven.plugin.MojoExecutionException: Unable to find/resolve
artifact.
at
org.apache.maven.plugins.dependency.fromConfiguration.TestCopyMojo.testCopyStripClassifierSetInMojo(TestCopyMojo.java:272)
Caused by:
org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException:

com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting: org.eclipse.aether.DefaultRepositorySystem
  at ClassRealm[plexus.core, parent: null]
  while locating org.eclipse.aether.RepositorySystem

1 error
      role: org.eclipse.aether.RepositorySystem
  roleHint:
at
org.apache.maven.plugins.dependency.fromConfiguration.TestCopyMojo.testCopyStripClassifierSetInMojo(TestCopyMojo.java:272)
Caused by:
org.codehaus.plexus.component.repository.exception.ComponentLookupException:

com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting: org.eclipse.aether.DefaultRepositorySystem
  at ClassRealm[plexus.core, parent: null]
  while locating org.eclipse.aether.RepositorySystem

1 error
      role: org.eclipse.aether.RepositorySystem
  roleHint:
at
org.apache.maven.plugins.dependency.fromConfiguration.TestCopyMojo.testCopyStripClassifierSetInMojo(TestCopyMojo.java:272)
Caused by: com.google.inject.ProvisionException:
Guice provision errors:

1) Error injecting: org.eclipse.aether.DefaultRepositorySystem
  at ClassRealm[plexus.core, parent: null]
  while locating org.eclipse.aether.RepositorySystem

1 error
at
org.apache.maven.plugins.dependency.fromConfiguration.TestCopyMojo.testCopyStripClassifierSetInMojo(TestCopyMojo.java:272)
Caused by: java.lang.TypeNotPresentException: Type
org.eclipse.aether.DefaultRepositorySystem not present
at
org.apache.maven.plugins.dependency.fromConfiguration.TestCopyMojo.testCopyStripClassifierSetInMojo(TestCopyMojo.java:272)
Caused by: java.lang.ClassNotFoundException:
org.eclipse.aether.DefaultRepositorySystem
at
org.apache.maven.plugins.dependency.fromConfiguration.TestCopyMojo.testCopyStripClassifierSetInMojo(TestCopyMojo.java:272)

On Fri, Jun 5, 2020 at 1:42 PM Ian Lavallee <[hidden email]> wrote:

> Hi Tomo,
>
> I sent this last night but I don't think it went through so I'm sending it
> again.
>
>
> https://github.com/ian-lavallee/maven-dependency-plugin/blob/removeTreeDependency/mvnVerifyOutput.txt
> this
> is the output for mvn verify -e and there is another txt containing the
> stacktrace of just the one test that is considerably shorter in the repo as
> well. The stacktrace is not very helpful since the issue happen in mojo
> doExecute and it crosses projects. The line that causes the issue is in
> maven-artifact-transfer DefaultArtifactResolver line 140, RepositorySystem
> repositorySystem =
> (RepositorySystem)this.container.lookup(RepositorySystem.class);
>
> On Thu, Jun 4, 2020 at 9:47 PM Tomo Suzuki <[hidden email]>
> wrote:
>
> > Hi Ian,
> > (I don’t have answer to your question)
> >
> > Do you have build failure log (including stacktrace) somewhere?
> > Would you share URL of your branch?
> >
> > On Thu, Jun 4, 2020 at 18:21 Ian Lavallee <[hidden email]>
> wrote:
> >
> > > Hi,
> > >
> > > I am working on ticket MDEP-644 Reintroduce the verbose option for
> > > dependency:tree. I'm having trouble with broken tests.
> > >
> > > I added org.apache.maven.resolver:maven-resolver-api:1.4.2 and
> > > org.apache.maven.resolver:maven-resolver-impl:1.4.2 and didn't change
> > > anything else and multiple tests broke.
> > > They are all failing when they lookup RepositorySystem.class in a
> plexus
> > > container. I think the issue has to do with the maven-resolver-impl jar
> > > file. Specifically, the maven-resolver-impl
> > > uses sisu Guice instead of plexus. The javax.inject.Named does have
> > > org.eclipse.aether.internal.impl.DefaultRepositorySystem in it. Does
> > anyone
> > > know how to make plexus work with Guice or have any links to resources
> on
> > > this topic?
> > >
> > > Thanks,
> > > Ian
> > >
> > --
> > Regards,
> > Tomo
> >
>


--
Regards,
Tomo