You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by nicolas de loof <ni...@gmail.com> on 2007/10/17 16:33:08 UTC
plexus classloader issue ?
Hello,
I've created a plugin that requires a plexus UnArchiver as @component.
The expected Unarchiver is declared by another plugin, configured as an
extensions.
All works fine when unit-testing the plugin using maven-test-harness, but
when I try to use it from another project (it test) I get this error :
Can not set org.codehaus.plexus.archiver.UnArchiver field
org.codehaus.mojo.javascript.AbstractCopyDependenciesMojo.archiver to
org.codehaus.plexus.archiver.zip.ZipUnArchiver
ZipUnArchiver implements UnArchiver ! So this seems to be a classloader
issue. Do you have any idea what can be wrong in my config, or any way to
investigate ?
Nico.
Re: plexus classloader issue ?
Posted by nicolas de loof <ni...@gmail.com>.
According to
http://maven.apache.org/guides/mini/guide-maven-classloading.html, using an
extension should work... I'll investigtate more tomorow.
2007/10/17, nicolas de loof <ni...@gmail.com>:
>
> My first plugin defines some custom components, shored with other plugins.
> It is used from other projects as a maven extension.
>
> My second plugin uses this component
>
> My main project uses the 2d plugin and has the 1rst one set as extension.
> The second plugin cannot initialize (classloader issue). Seems the
> UnArchiver class loaded in 2d plugin isn't same as the ZipArchiver ->
> UnArchiver loaded by the first plugin.
>
> I think plugins use separate classloaders :
>
>
> Maven project classloader
> |
> ----- 1rst plugin classloader [ ZipArchiver -> UnArchiver ] as
> <extension>
> | -> custom component added to plexus
> |
> ----- 2nd plugin classloader [ Unarchiver ]
>
> With such config, ZipArchiver is not assignable to UnArchiver.
>
> I don't see any way for a plugin to expose extensions to other plugins...
> This would require the extension classpath to be added to the project
> classloader.
>
> Nico.
>
>
>
> 2007/10/17, Andrew Williams <an...@handyande.co.uk>:
> >
> > Why are you trying to load the dependencies of another plugin instead
> > of specifying them yourself?
> >
> > Andy
> >
> > On 17 Oct 2007, at 16:31, nicolas de loof wrote:
> >
> > > Not sure to understand what you would like me to see in the dependency
> > > plugin.
> > >
> > > I get my unarchiver using plexus dependency mecanism :
> > >
> > > /**
> > > * @parameter expression="${
> > > component.org.codehaus.plexus.archiver.UnArchiver#jsar}"
> > > * @required
> > > */
> > > private UnArchiver archiver;
> > >
> > > With my other plugin defining a component in META-INF/plexus.xml :
> > >
> > > <component>
> > > <role>org.codehaus.plexus.archiver.UnArchiver</role>
> > > <role-hint>jsar</role-hint>
> > > <implementation>org.codehaus.plexus.archiver.zip.ZipUnArchiver
> > > </implementation>
> > > </component>
> > >
> > >
> > > This worked as expected when the unarchiver was defined in the
> > > plugin that
> > > uses the archiver, but not if the unarchiver is defined bu another
> > > plugin. I
> > > supose those plugins have separate classloaders.
> > >
> > > Any workaround ?
> > >
> > >
> > > 2007/10/17, Brian E. Fox <br...@reply.infinity.nu>:
> > >>
> > >> Take a look at the dependency plugin for use of the unarchiver.
> > >>
> > >> -----Original Message-----
> > >> From: nicolas de loof [mailto:nicolas.deloof@gmail.com]
> > >> Sent: Wednesday, October 17, 2007 10:33 AM
> > >> To: Maven Developers List
> > >> Subject: plexus classloader issue ?
> > >>
> > >> Hello,
> > >>
> > >> I've created a plugin that requires a plexus UnArchiver as
> > >> @component.
> > >> The expected Unarchiver is declared by another plugin, configured
> > >> as an
> > >> extensions.
> > >>
> > >> All works fine when unit-testing the plugin using maven-test-harness,
> > >> but
> > >> when I try to use it from another project (it test) I get this
> > >> error :
> > >>
> > >> Can not set org.codehaus.plexus.archiver.UnArchiver field
> > >> org.codehaus.mojo.javascript.AbstractCopyDependenciesMojo.archiver to
> > >> org.codehaus.plexus.archiver.zip.ZipUnArchiver
> > >>
> > >> ZipUnArchiver implements UnArchiver ! So this seems to be a
> > >> classloader
> > >> issue. Do you have any idea what can be wrong in my config, or any
> > >> way
> > >> to
> > >> investigate ?
> > >>
> > >> Nico.
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: dev-help@maven.apache.org
> > >>
> > >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
>
Re: plexus classloader issue ?
Posted by nicolas de loof <ni...@gmail.com>.
Is there no plexus equivalent to spring lazy-init=false ?
2007/10/18, Brian E. Fox <br...@reply.infinity.nu>:
>
> You can implement contextualizable and then get the container where you
> could get the ArchiverManager. However, I imagine plexus wouldn't
> instantiate your object until it was needed, so chicken or egg.
>
> -----Original Message-----
> From: nicolas de loof [mailto:nicolas.deloof@gmail.com]
> Sent: Thursday, October 18, 2007 10:54 AM
> To: Maven Developers List
> Subject: Re: plexus classloader issue ?
>
> Right,
>
> I've bundled my extensions in a jar that only contains a plexus
> component.xml for custom lifecycle and handlers.
>
> I have to set my extension as both <build><extensions> and
> <build><plugins><extensions=true
> If I don't set the plugin, my artifactHandler is not registered and my
> dependencies (with custom archive format) are not downloaded.
>
> Is there any way for an extension to get some "bootstrap" component ?
> Some
> plexus lifecycle interface that will be invoked even if the component
> is
> not looked-up ? I'd like to regsiter my custom artifactHandler to the
> ArtifactHandlerManager before maven tries to resolve project
> dependencies.
>
> Nico.
>
>
> 2007/10/18, Brian E. Fox <br...@reply.infinity.nu>:
> >
> > You definitely want your lifecycle and handlers separated from the
> > plugin. The extensions are loaded into the core classloader and if you
> > plugin pulls in things like velocity, it will mess up other plugins.
> (we
> > had this problem with archetypeng). Also, don't ever use a plugin as a
> > dependency, other bad things can happen.
> >
> > -----Original Message-----
> > From: nicolas de loof [mailto:nicolas.deloof@gmail.com]
> > Sent: Thursday, October 18, 2007 4:41 AM
> > To: Maven Developers List
> > Subject: Re: plexus classloader issue ?
> >
> > My extension also defines maven extensions (custom lifecycle and
> > ArtifactHandler)
> > I'll have to split it into extension and common-tools, so that
> > common-tools
> > can be shared as a dependency.
> >
> > 2007/10/18, Tim Kettler <ti...@udo.edu>:
> > >
> > > Hi,
> > >
> > > nicolas de loof schrieb:
> > > > My first plugin defines some custom components, shored with other
> > > plugins.
> > > > It is used from other projects as a maven extension.
> > > >
> > > > My second plugin uses this component
> > > >
> > > > My main project uses the 2d plugin and has the 1rst one set as
> > > extension.
> > > > The second plugin cannot initialize (classloader issue). Seems the
> > > > UnArchiver class loaded in 2d plugin isn't same as the ZipArchiver
> > ->
> > > > UnArchiver loaded by the first plugin.
> > >
> > > Why don't you just put the shared components in a library jar and
> > depend
> > > on that in both plugins. I think, that's the proper way of doing it
> > and
> > > would avoid classloader issues and having to use the extensions hack
> > > altogether.
> > >
> > > > I think plugins use separate classloaders :
> > >
> > > Yes, each plugin uses its own plexus child container.
> > >
> > > [...]
> > >
> > > >>>>
> > > >>>> Nico.
> > > >>>>
> > >
> > > -Tim
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
RE: plexus classloader issue ?
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
You can implement contextualizable and then get the container where you
could get the ArchiverManager. However, I imagine plexus wouldn't
instantiate your object until it was needed, so chicken or egg.
-----Original Message-----
From: nicolas de loof [mailto:nicolas.deloof@gmail.com]
Sent: Thursday, October 18, 2007 10:54 AM
To: Maven Developers List
Subject: Re: plexus classloader issue ?
Right,
I've bundled my extensions in a jar that only contains a plexus
component.xml for custom lifecycle and handlers.
I have to set my extension as both <build><extensions> and
<build><plugins><extensions=true
If I don't set the plugin, my artifactHandler is not registered and my
dependencies (with custom archive format) are not downloaded.
Is there any way for an extension to get some "bootstrap" component ?
Some
plexus lifecycle interface that will be invoked even if the component
is
not looked-up ? I'd like to regsiter my custom artifactHandler to the
ArtifactHandlerManager before maven tries to resolve project
dependencies.
Nico.
2007/10/18, Brian E. Fox <br...@reply.infinity.nu>:
>
> You definitely want your lifecycle and handlers separated from the
> plugin. The extensions are loaded into the core classloader and if you
> plugin pulls in things like velocity, it will mess up other plugins.
(we
> had this problem with archetypeng). Also, don't ever use a plugin as a
> dependency, other bad things can happen.
>
> -----Original Message-----
> From: nicolas de loof [mailto:nicolas.deloof@gmail.com]
> Sent: Thursday, October 18, 2007 4:41 AM
> To: Maven Developers List
> Subject: Re: plexus classloader issue ?
>
> My extension also defines maven extensions (custom lifecycle and
> ArtifactHandler)
> I'll have to split it into extension and common-tools, so that
> common-tools
> can be shared as a dependency.
>
> 2007/10/18, Tim Kettler <ti...@udo.edu>:
> >
> > Hi,
> >
> > nicolas de loof schrieb:
> > > My first plugin defines some custom components, shored with other
> > plugins.
> > > It is used from other projects as a maven extension.
> > >
> > > My second plugin uses this component
> > >
> > > My main project uses the 2d plugin and has the 1rst one set as
> > extension.
> > > The second plugin cannot initialize (classloader issue). Seems the
> > > UnArchiver class loaded in 2d plugin isn't same as the ZipArchiver
> ->
> > > UnArchiver loaded by the first plugin.
> >
> > Why don't you just put the shared components in a library jar and
> depend
> > on that in both plugins. I think, that's the proper way of doing it
> and
> > would avoid classloader issues and having to use the extensions hack
> > altogether.
> >
> > > I think plugins use separate classloaders :
> >
> > Yes, each plugin uses its own plexus child container.
> >
> > [...]
> >
> > >>>>
> > >>>> Nico.
> > >>>>
> >
> > -Tim
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: plexus classloader issue ?
Posted by nicolas de loof <ni...@gmail.com>.
Right,
I've bundled my extensions in a jar that only contains a plexus
component.xml for custom lifecycle and handlers.
I have to set my extension as both <build><extensions> and
<build><plugins><extensions=true
If I don't set the plugin, my artifactHandler is not registered and my
dependencies (with custom archive format) are not downloaded.
Is there any way for an extension to get some "bootstrap" component ? Some
plexus lifecycle interface that will be invoked even if the component is
not looked-up ? I'd like to regsiter my custom artifactHandler to the
ArtifactHandlerManager before maven tries to resolve project dependencies.
Nico.
2007/10/18, Brian E. Fox <br...@reply.infinity.nu>:
>
> You definitely want your lifecycle and handlers separated from the
> plugin. The extensions are loaded into the core classloader and if you
> plugin pulls in things like velocity, it will mess up other plugins. (we
> had this problem with archetypeng). Also, don't ever use a plugin as a
> dependency, other bad things can happen.
>
> -----Original Message-----
> From: nicolas de loof [mailto:nicolas.deloof@gmail.com]
> Sent: Thursday, October 18, 2007 4:41 AM
> To: Maven Developers List
> Subject: Re: plexus classloader issue ?
>
> My extension also defines maven extensions (custom lifecycle and
> ArtifactHandler)
> I'll have to split it into extension and common-tools, so that
> common-tools
> can be shared as a dependency.
>
> 2007/10/18, Tim Kettler <ti...@udo.edu>:
> >
> > Hi,
> >
> > nicolas de loof schrieb:
> > > My first plugin defines some custom components, shored with other
> > plugins.
> > > It is used from other projects as a maven extension.
> > >
> > > My second plugin uses this component
> > >
> > > My main project uses the 2d plugin and has the 1rst one set as
> > extension.
> > > The second plugin cannot initialize (classloader issue). Seems the
> > > UnArchiver class loaded in 2d plugin isn't same as the ZipArchiver
> ->
> > > UnArchiver loaded by the first plugin.
> >
> > Why don't you just put the shared components in a library jar and
> depend
> > on that in both plugins. I think, that's the proper way of doing it
> and
> > would avoid classloader issues and having to use the extensions hack
> > altogether.
> >
> > > I think plugins use separate classloaders :
> >
> > Yes, each plugin uses its own plexus child container.
> >
> > [...]
> >
> > >>>>
> > >>>> Nico.
> > >>>>
> >
> > -Tim
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
RE: plexus classloader issue ?
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
You definitely want your lifecycle and handlers separated from the
plugin. The extensions are loaded into the core classloader and if you
plugin pulls in things like velocity, it will mess up other plugins. (we
had this problem with archetypeng). Also, don't ever use a plugin as a
dependency, other bad things can happen.
-----Original Message-----
From: nicolas de loof [mailto:nicolas.deloof@gmail.com]
Sent: Thursday, October 18, 2007 4:41 AM
To: Maven Developers List
Subject: Re: plexus classloader issue ?
My extension also defines maven extensions (custom lifecycle and
ArtifactHandler)
I'll have to split it into extension and common-tools, so that
common-tools
can be shared as a dependency.
2007/10/18, Tim Kettler <ti...@udo.edu>:
>
> Hi,
>
> nicolas de loof schrieb:
> > My first plugin defines some custom components, shored with other
> plugins.
> > It is used from other projects as a maven extension.
> >
> > My second plugin uses this component
> >
> > My main project uses the 2d plugin and has the 1rst one set as
> extension.
> > The second plugin cannot initialize (classloader issue). Seems the
> > UnArchiver class loaded in 2d plugin isn't same as the ZipArchiver
->
> > UnArchiver loaded by the first plugin.
>
> Why don't you just put the shared components in a library jar and
depend
> on that in both plugins. I think, that's the proper way of doing it
and
> would avoid classloader issues and having to use the extensions hack
> altogether.
>
> > I think plugins use separate classloaders :
>
> Yes, each plugin uses its own plexus child container.
>
> [...]
>
> >>>>
> >>>> Nico.
> >>>>
>
> -Tim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: plexus classloader issue ?
Posted by nicolas de loof <ni...@gmail.com>.
My extension also defines maven extensions (custom lifecycle and
ArtifactHandler)
I'll have to split it into extension and common-tools, so that common-tools
can be shared as a dependency.
2007/10/18, Tim Kettler <ti...@udo.edu>:
>
> Hi,
>
> nicolas de loof schrieb:
> > My first plugin defines some custom components, shored with other
> plugins.
> > It is used from other projects as a maven extension.
> >
> > My second plugin uses this component
> >
> > My main project uses the 2d plugin and has the 1rst one set as
> extension.
> > The second plugin cannot initialize (classloader issue). Seems the
> > UnArchiver class loaded in 2d plugin isn't same as the ZipArchiver ->
> > UnArchiver loaded by the first plugin.
>
> Why don't you just put the shared components in a library jar and depend
> on that in both plugins. I think, that's the proper way of doing it and
> would avoid classloader issues and having to use the extensions hack
> altogether.
>
> > I think plugins use separate classloaders :
>
> Yes, each plugin uses its own plexus child container.
>
> [...]
>
> >>>>
> >>>> Nico.
> >>>>
>
> -Tim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
Re: plexus classloader issue ?
Posted by Tim Kettler <ti...@udo.edu>.
Hi,
nicolas de loof schrieb:
> My first plugin defines some custom components, shored with other plugins.
> It is used from other projects as a maven extension.
>
> My second plugin uses this component
>
> My main project uses the 2d plugin and has the 1rst one set as extension.
> The second plugin cannot initialize (classloader issue). Seems the
> UnArchiver class loaded in 2d plugin isn't same as the ZipArchiver ->
> UnArchiver loaded by the first plugin.
Why don't you just put the shared components in a library jar and depend
on that in both plugins. I think, that's the proper way of doing it and
would avoid classloader issues and having to use the extensions hack
altogether.
> I think plugins use separate classloaders :
Yes, each plugin uses its own plexus child container.
[...]
>>>>
>>>> Nico.
>>>>
-Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: plexus classloader issue ?
Posted by nicolas de loof <ni...@gmail.com>.
My first plugin defines some custom components, shored with other plugins.
It is used from other projects as a maven extension.
My second plugin uses this component
My main project uses the 2d plugin and has the 1rst one set as extension.
The second plugin cannot initialize (classloader issue). Seems the
UnArchiver class loaded in 2d plugin isn't same as the ZipArchiver ->
UnArchiver loaded by the first plugin.
I think plugins use separate classloaders :
Maven project classloader
|
----- 1rst plugin classloader [ ZipArchiver -> UnArchiver ] as <extension>
| -> custom component added to plexus
|
----- 2nd plugin classloader [ Unarchiver ]
With such config, ZipArchiver is not assignable to UnArchiver.
I don't see any way for a plugin to expose extensions to other plugins...
This would require the extension classpath to be added to the project
classloader.
Nico.
2007/10/17, Andrew Williams <an...@handyande.co.uk>:
>
> Why are you trying to load the dependencies of another plugin instead
> of specifying them yourself?
>
> Andy
>
> On 17 Oct 2007, at 16:31, nicolas de loof wrote:
>
> > Not sure to understand what you would like me to see in the dependency
> > plugin.
> >
> > I get my unarchiver using plexus dependency mecanism :
> >
> > /**
> > * @parameter expression="${
> > component.org.codehaus.plexus.archiver.UnArchiver#jsar}"
> > * @required
> > */
> > private UnArchiver archiver;
> >
> > With my other plugin defining a component in META-INF/plexus.xml :
> >
> > <component>
> > <role>org.codehaus.plexus.archiver.UnArchiver</role>
> > <role-hint>jsar</role-hint>
> > <implementation>org.codehaus.plexus.archiver.zip.ZipUnArchiver
> > </implementation>
> > </component>
> >
> >
> > This worked as expected when the unarchiver was defined in the
> > plugin that
> > uses the archiver, but not if the unarchiver is defined bu another
> > plugin. I
> > supose those plugins have separate classloaders.
> >
> > Any workaround ?
> >
> >
> > 2007/10/17, Brian E. Fox <br...@reply.infinity.nu>:
> >>
> >> Take a look at the dependency plugin for use of the unarchiver.
> >>
> >> -----Original Message-----
> >> From: nicolas de loof [mailto:nicolas.deloof@gmail.com]
> >> Sent: Wednesday, October 17, 2007 10:33 AM
> >> To: Maven Developers List
> >> Subject: plexus classloader issue ?
> >>
> >> Hello,
> >>
> >> I've created a plugin that requires a plexus UnArchiver as
> >> @component.
> >> The expected Unarchiver is declared by another plugin, configured
> >> as an
> >> extensions.
> >>
> >> All works fine when unit-testing the plugin using maven-test-harness,
> >> but
> >> when I try to use it from another project (it test) I get this
> >> error :
> >>
> >> Can not set org.codehaus.plexus.archiver.UnArchiver field
> >> org.codehaus.mojo.javascript.AbstractCopyDependenciesMojo.archiver to
> >> org.codehaus.plexus.archiver.zip.ZipUnArchiver
> >>
> >> ZipUnArchiver implements UnArchiver ! So this seems to be a
> >> classloader
> >> issue. Do you have any idea what can be wrong in my config, or any
> >> way
> >> to
> >> investigate ?
> >>
> >> Nico.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
Re: plexus classloader issue ?
Posted by Andrew Williams <an...@handyande.co.uk>.
Why are you trying to load the dependencies of another plugin instead
of specifying them yourself?
Andy
On 17 Oct 2007, at 16:31, nicolas de loof wrote:
> Not sure to understand what you would like me to see in the dependency
> plugin.
>
> I get my unarchiver using plexus dependency mecanism :
>
> /**
> * @parameter expression="${
> component.org.codehaus.plexus.archiver.UnArchiver#jsar}"
> * @required
> */
> private UnArchiver archiver;
>
> With my other plugin defining a component in META-INF/plexus.xml :
>
> <component>
> <role>org.codehaus.plexus.archiver.UnArchiver</role>
> <role-hint>jsar</role-hint>
> <implementation>org.codehaus.plexus.archiver.zip.ZipUnArchiver
> </implementation>
> </component>
>
>
> This worked as expected when the unarchiver was defined in the
> plugin that
> uses the archiver, but not if the unarchiver is defined bu another
> plugin. I
> supose those plugins have separate classloaders.
>
> Any workaround ?
>
>
> 2007/10/17, Brian E. Fox <br...@reply.infinity.nu>:
>>
>> Take a look at the dependency plugin for use of the unarchiver.
>>
>> -----Original Message-----
>> From: nicolas de loof [mailto:nicolas.deloof@gmail.com]
>> Sent: Wednesday, October 17, 2007 10:33 AM
>> To: Maven Developers List
>> Subject: plexus classloader issue ?
>>
>> Hello,
>>
>> I've created a plugin that requires a plexus UnArchiver as
>> @component.
>> The expected Unarchiver is declared by another plugin, configured
>> as an
>> extensions.
>>
>> All works fine when unit-testing the plugin using maven-test-harness,
>> but
>> when I try to use it from another project (it test) I get this
>> error :
>>
>> Can not set org.codehaus.plexus.archiver.UnArchiver field
>> org.codehaus.mojo.javascript.AbstractCopyDependenciesMojo.archiver to
>> org.codehaus.plexus.archiver.zip.ZipUnArchiver
>>
>> ZipUnArchiver implements UnArchiver ! So this seems to be a
>> classloader
>> issue. Do you have any idea what can be wrong in my config, or any
>> way
>> to
>> investigate ?
>>
>> Nico.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: plexus classloader issue ?
Posted by nicolas de loof <ni...@gmail.com>.
Not sure to understand what you would like me to see in the dependency
plugin.
I get my unarchiver using plexus dependency mecanism :
/**
* @parameter expression="${
component.org.codehaus.plexus.archiver.UnArchiver#jsar}"
* @required
*/
private UnArchiver archiver;
With my other plugin defining a component in META-INF/plexus.xml :
<component>
<role>org.codehaus.plexus.archiver.UnArchiver</role>
<role-hint>jsar</role-hint>
<implementation>org.codehaus.plexus.archiver.zip.ZipUnArchiver
</implementation>
</component>
This worked as expected when the unarchiver was defined in the plugin that
uses the archiver, but not if the unarchiver is defined bu another plugin. I
supose those plugins have separate classloaders.
Any workaround ?
2007/10/17, Brian E. Fox <br...@reply.infinity.nu>:
>
> Take a look at the dependency plugin for use of the unarchiver.
>
> -----Original Message-----
> From: nicolas de loof [mailto:nicolas.deloof@gmail.com]
> Sent: Wednesday, October 17, 2007 10:33 AM
> To: Maven Developers List
> Subject: plexus classloader issue ?
>
> Hello,
>
> I've created a plugin that requires a plexus UnArchiver as @component.
> The expected Unarchiver is declared by another plugin, configured as an
> extensions.
>
> All works fine when unit-testing the plugin using maven-test-harness,
> but
> when I try to use it from another project (it test) I get this error :
>
> Can not set org.codehaus.plexus.archiver.UnArchiver field
> org.codehaus.mojo.javascript.AbstractCopyDependenciesMojo.archiver to
> org.codehaus.plexus.archiver.zip.ZipUnArchiver
>
> ZipUnArchiver implements UnArchiver ! So this seems to be a classloader
> issue. Do you have any idea what can be wrong in my config, or any way
> to
> investigate ?
>
> Nico.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
RE: plexus classloader issue ?
Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Take a look at the dependency plugin for use of the unarchiver.
-----Original Message-----
From: nicolas de loof [mailto:nicolas.deloof@gmail.com]
Sent: Wednesday, October 17, 2007 10:33 AM
To: Maven Developers List
Subject: plexus classloader issue ?
Hello,
I've created a plugin that requires a plexus UnArchiver as @component.
The expected Unarchiver is declared by another plugin, configured as an
extensions.
All works fine when unit-testing the plugin using maven-test-harness,
but
when I try to use it from another project (it test) I get this error :
Can not set org.codehaus.plexus.archiver.UnArchiver field
org.codehaus.mojo.javascript.AbstractCopyDependenciesMojo.archiver to
org.codehaus.plexus.archiver.zip.ZipUnArchiver
ZipUnArchiver implements UnArchiver ! So this seems to be a classloader
issue. Do you have any idea what can be wrong in my config, or any way
to
investigate ?
Nico.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org