On 7 June 2010 07:25, Olivier Lamy <[email protected]> wrote:

> Hi,
> I have tested some builds.
> Some notes.
> I have this issues currently :
>
> java.lang.UnsupportedOperationException
>        at java.util.AbstractMap.put(AbstractMap.java:186)
>        at
> org.apache.maven.scm.manager.AbstractScmManager.setScmProvider(AbstractScmManager.java:93)
>
> Now the Map is not any more writable ?
>

correct - the new container is much more strict about
components monkeying around with internals, such as
directly modifying injected dynamic collections

if you look at the old Plexus collections code it does
log a warning if you add components directly into the
injected maps / lists, because it makes the internal
book-keeping and synchronization very complicated

there is a simple workaround which is to push the
contents of the injected map into your own mutable
map, for example by using a setter method like so:

  private Map<Foo> fooMap;

  private void setFooMap( Map<Foo> fooMap )
  {
    this.fooMap = new HashMap<Foo>( fooMap );
  }

the new container would inject the setter method
instead of the field (ie. the setter hides the field)
and your code would still work with Plexus

I'm not sure something like [1] will works now. (Not tested as I have
> to cut a release :-) )
>
> AN other issue using the old plugin
> org.codehaus.plexus:plexus-maven-plugin give me :
> -----------------------------------------------------:
> NoClassDefFoundError:
> org.codehaus.plexus.personality.plexus.lifecycle.phase.Suspendable
>
> so upgrading to org.codehaus.plexus:plexus-component-metadata:1.5.4
> fix the issue.
>

the new container may be missing some of the more
obscure parts of Plexus, because we took a minimal
approach to keep it lean - any missing pieces can be
reported at https://issues.sonatype.org/browse/SPICE

I will tests it with some other build (@work).
>

thanks


> [1]
> http://code.google.com/p/maven-scm-provider-svnjava/wiki/UsingWithReleasePlugin
>
>
> 2010/6/7 Jemos Infra <[email protected]>:
> > Hi all,
> >
> > I'm working on the Maven 3 branch created today by Olivier Lamy
> >
> > [email quote]
> > stuff is here :
> > http://svn.apache.org/repos/asf/maven/maven-3/branches/guice-support/
> >
> > Thanks !
> > [/email quote]
> >
> > This branch is supposed to have the Maven 3 version which uses Guice
> > instead of Plexus (actually still uses Plexus to startup but the wiring
> > is done by Guice).
> >
> > I noticed that from this branch the tests are still in Junit 3. Would it
> > be ok to move those to TestNG (preferred) or Junit 4? I could do some
> > work on these if you like.
> >
> > M.
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
>
>
> --
> Olivier
> http://twitter.com/olamy
> http://fr.linkedin.com/in/olamy
> http://www.viadeo.com/fr/profile/olivier.lamy7
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

-- 
Cheers, Stuart

Reply via email to