I have created a small project that can replicate the error here
https://github.com/ian-lavallee/ContainerTest/tree/master/src/test/java

Currently if you run mvn verify it will pass the test but it only passed
the test if I added the components.xml with the binding for
RepositorySystem but it doesn't seem possible to fix the issue for the
dependency plugin that way. To make the test fail in the same way as the
other projects just remove the components.xml and run mvn verify.

On Fri, Jun 5, 2020 at 5:10 PM Tomo Suzuki <[email protected]>
wrote:

> 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 <[email protected]>
> 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 <[email protected]>
> > 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 <[email protected]>
> > 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
>

Reply via email to