On 29 May 2013, at 14:33, Simone Tripodi wrote:

> Hi Stuart! :)
> 
> thanks a lot for jumping in the discussion, very appreciated! :)
> 
>> 
>> Maven3 never exposed those packages from the core and the individual 
>> guice-bean/plexus-* jars were never used in Maven3, only the final 
>> sisu-inject-bean/plexus aggregate jars.
>> If you've added your own dependencies to guice-bean/plexus-* jars then this 
>> is likely the cause of the conflict because they'll be implementing the same 
>> API as the aggregate jars.
> 
> Nope I didn't add any guice-bean* dependency manually, they are all
> inherited by maven-core as transitive dependencies. The only plexus-*
> dependency I added is org.codehaus.plexus:plexus-utils:3.0.1

Actually by guice-bean/plexus-* I meant guice-bean-* and guice-plexus-* (ie. 
the modules that eventually feed into sisu-inject-bean and sisu-inject-plexus 
respectively)

>> Do you have a link to your test project? If you remove all 
>> guice-bean/plexus-* dependencies then you'll probably find it works.
> 
> Nope, unfortunately, it is not an OSS project :( I hope that the
> POM[1] only can help you to understand where the mistake is...

I didn't see any guice-bean-* dependency when I took your POM (without parent) 
and ran it through dependency:tree so maybe the parent POM is affecting the 
dependencies.

Any chance you could post the results of dependency:tree from your real 
project? (with internal details redacted of course)

I also took your POM and pasted it into a sample mojo project plus tests and 
was able to get it to work once I added a dependency to 
"org.apache.maven:maven-compat" (provides some legacy APIs used by the plugin 
test harness) 

Also note that the Aether API will change in Maven 3.1.0 
(org.sonatype.aether->org.eclipse.aether) so where possible it's better to 
stick to the standard Maven APIs, otherwise you have to be prepared to handle 
the upcoming package change.

>> In Eclipse/Sisu I've collapsed these interim jars because while they could 
>> technically be re-used individually it was actually simpler (and smaller) to 
>> keep them in the same bundle.
> 
> I am maybe off-topic here, but what do you think about the approach we
> adopted in Onami, where we distribute small modules AND the collapsed
> jar?

It works, but for Sisu everyone just wants the aggregate jar so it wasn't worth 
the effort of maintaining the separate modules (and some people found the extra 
choice confusing).

> Many thanks for your help and have a nice day!
> All the best,
> -Simo
> 
> [1] https://gist.github.com/simonetripodi/5670183
> 
> http://people.apache.org/~simonetripodi/
> http://twitter.com/simonetripodi
> 
> 
> On Wed, May 29, 2013 at 12:05 PM, Stuart McCulloch <mccu...@gmail.com> wrote:
>> On 29 May 2013, at 10:49, Simone Tripodi wrote:
>> 
>>> Hi all mates,
>>> 
>>> I am updating a set of old Maven plugins using Mvn3+Aether APIs, but
>>> unfortunately I am no longer able to run Mvn tests due to
>>> org.sonatype.guice.bean.reflect.Logs class cannot be found in the
>>> classpath, follows below the (almost) complete stacktrace (what is
>>> missing is just the test class - it is not an OSS project).
>>> 
>>> All guice-bean* dependencies are included in the project, included the
>>> guice-bean-reflect-2.3.0 that contains the missing class.
>>> 
>>> Do you know why I get that error?
>> 
>> Maven3 never exposed those packages from the core and the individual 
>> guice-bean/plexus-* jars were never used in Maven3, only the final 
>> sisu-inject-bean/plexus aggregate jars.
>> 
>> If you've added your own dependencies to guice-bean/plexus-* jars then this 
>> is likely the cause of the conflict because they'll be implementing the same 
>> API as the aggregate jars.
>> 
>> Do you have a link to your test project? If you remove all 
>> guice-bean/plexus-* dependencies then you'll probably find it works.
>> 
>> In Eclipse/Sisu I've collapsed these interim jars because while they could 
>> technically be re-used individually it was actually simpler (and smaller) to 
>> keep them in the same bundle.
>> 
>>> Any hint would be much more than appreciated!
>>> Many thanks in advance, all the best!
>>> -Simo
>>> 
>>> java.lang.NoClassDefFoundError: Could not initialize class
>>> org.sonatype.guice.bean.reflect.Logs
>>>      at 
>>> org.sonatype.guice.plexus.scanners.PlexusTypeRegistry.loadRole(PlexusTypeRegistry.java:194)
>>>      at 
>>> org.sonatype.guice.plexus.scanners.PlexusTypeRegistry.addComponent(PlexusTypeRegistry.java:110)
>>>      at 
>>> org.sonatype.guice.plexus.scanners.PlexusXmlScanner.parseComponent(PlexusXmlScanner.java:329)
>>>      at 
>>> org.sonatype.guice.plexus.scanners.PlexusXmlScanner.parseComponentsXml(PlexusXmlScanner.java:198)
>>>      at 
>>> org.sonatype.guice.plexus.scanners.PlexusXmlScanner.scan(PlexusXmlScanner.java:94)
>>>      at 
>>> org.sonatype.guice.plexus.binders.PlexusXmlBeanModule.configure(PlexusXmlBeanModule.java:89)
>>>      at 
>>> org.sonatype.guice.plexus.binders.PlexusBindingModule.configure(PlexusBindingModule.java:62)
>>>      at 
>>> com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:229)
>>>      at com.google.inject.spi.Elements.getElements(Elements.java:103)
>>>      at com.google.inject.spi.Elements.getElements(Elements.java:80)
>>>      at 
>>> org.sonatype.guice.bean.binders.MergedModule.configure(MergedModule.java:54)
>>>      at 
>>> com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:229)
>>>      at com.google.inject.spi.Elements.getElements(Elements.java:103)
>>>      at 
>>> com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:136)
>>>      at 
>>> com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
>>>      at com.google.inject.Guice.createInjector(Guice.java:94)
>>>      at com.google.inject.Guice.createInjector(Guice.java:71)
>>>      at com.google.inject.Guice.createInjector(Guice.java:61)
>>>      at 
>>> org.codehaus.plexus.DefaultPlexusContainer.addPlexusInjector(DefaultPlexusContainer.java:470)
>>>      at 
>>> org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:196)
>>>      at 
>>> org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:160)
>>>      at 
>>> org.apache.maven.plugin.testing.AbstractMojoTestCase.setupContainer(AbstractMojoTestCase.java:159)
>>>      at 
>>> org.apache.maven.plugin.testing.AbstractMojoTestCase.getContainer(AbstractMojoTestCase.java:179)
>>>      at 
>>> org.apache.maven.plugin.testing.AbstractMojoTestCase.setUp(AbstractMojoTestCase.java:107)
>>> 
>>> http://people.apache.org/~simonetripodi/
>>> http://twitter.com/simonetripodi
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>>> For additional commands, e-mail: users-h...@maven.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> For additional commands, e-mail: users-h...@maven.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to