You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by David Hoffer <dh...@gmail.com> on 2009/08/04 00:04:58 UTC

Surefire: How to specify jar class loading order?

I have found a case where mvn install & deploy work fine but site-deploy
does not.  The reason is that during site-deploy the surefire plugin is
building a class loading list in the surefirebooter jar's Manifest that is
different.

The reason this matters in my case is that I have some class overrides in
one of my child poms (multi-module project).  Its important that my child
artifact with the overrides gets added to the classpath first.  I don't know
what logic surefire uses to know what order to use but in the case of
site-deploy it is putting the original before my override.

I want to be able to specify the jar class loading order surefire uses (like
I could do in a war for instance at runtime).  How can I do this with
surefire?

-Dave

Re: Surefire: How to specify jar class loading order?

Posted by David Hoffer <dh...@gmail.com>.
Any thoughts on how I should resolve this?  Here are some options I thought
of.

1. Does the surefire plugin allow jar order to be specified via
configuration?

2. Put a copy of the overrides in each artifact under test so they always
endup in the classes folder.

3. Apply the overrides to the artifact being overridden.  I could create yet
another child module that patches the overridden artifact so I endup with a
patched version.  This might be the cleanest solution as it removes any
overrides from being in the runtime classpath, however I really don't need
this solution as in wars, etc I can control the ordering of the jar loading.

4. ??

-Dave


On Tue, Aug 4, 2009 at 12:49 AM, Stephen Connolly <
stephen.alan.connolly@gmail.com> wrote:

> OK, well there goes my "It's the maven versions that use hashmap and not
> linkedhashmap" theory...
>
> -Stephen
>
> 2009/8/4 David Hoffer <dh...@gmail.com>
>
> > I just verified, all our builds are using 2.1.0.
> >
> > -Dave
> >
> > On Mon, Aug 3, 2009 at 7:18 PM, David Hoffer <dh...@gmail.com> wrote:
> >
> > > No, I'm using 2.1x.
> > >
> > > -Dave
> > >
> > >
> > > On Mon, Aug 3, 2009 at 4:22 PM, Stephen Connolly <
> > > stephen.alan.connolly@gmail.com> wrote:
> > >
> > >> I am going to guess that you are using a version of maven < 2.0.9
> > >>
> > >> if I am wrong, let us know
> > >>
> > >> Sent from my [rhymes with myPod] ;-)
> > >>
> > >>
> > >> On 3 Aug 2009, at 23:04, David Hoffer <dh...@gmail.com> wrote:
> > >>
> > >>  I have found a case where mvn install & deploy work fine but
> > site-deploy
> > >>> does not.  The reason is that during site-deploy the surefire plugin
> is
> > >>> building a class loading list in the surefirebooter jar's Manifest
> that
> > >>> is
> > >>> different.
> > >>>
> > >>> The reason this matters in my case is that I have some class
> overrides
> > in
> > >>> one of my child poms (multi-module project).  Its important that my
> > child
> > >>> artifact with the overrides gets added to the classpath first.  I
> don't
> > >>> know
> > >>> what logic surefire uses to know what order to use but in the case of
> > >>> site-deploy it is putting the original before my override.
> > >>>
> > >>> I want to be able to specify the jar class loading order surefire
> uses
> > >>> (like
> > >>> I could do in a war for instance at runtime).  How can I do this with
> > >>> surefire?
> > >>>
> > >>> -Dave
> > >>>
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: users-help@maven.apache.org
> > >>
> > >>
> > >
> >
>

Re: Surefire: How to specify jar class loading order?

Posted by Stephen Connolly <st...@gmail.com>.
OK, well there goes my "It's the maven versions that use hashmap and not
linkedhashmap" theory...

-Stephen

2009/8/4 David Hoffer <dh...@gmail.com>

> I just verified, all our builds are using 2.1.0.
>
> -Dave
>
> On Mon, Aug 3, 2009 at 7:18 PM, David Hoffer <dh...@gmail.com> wrote:
>
> > No, I'm using 2.1x.
> >
> > -Dave
> >
> >
> > On Mon, Aug 3, 2009 at 4:22 PM, Stephen Connolly <
> > stephen.alan.connolly@gmail.com> wrote:
> >
> >> I am going to guess that you are using a version of maven < 2.0.9
> >>
> >> if I am wrong, let us know
> >>
> >> Sent from my [rhymes with myPod] ;-)
> >>
> >>
> >> On 3 Aug 2009, at 23:04, David Hoffer <dh...@gmail.com> wrote:
> >>
> >>  I have found a case where mvn install & deploy work fine but
> site-deploy
> >>> does not.  The reason is that during site-deploy the surefire plugin is
> >>> building a class loading list in the surefirebooter jar's Manifest that
> >>> is
> >>> different.
> >>>
> >>> The reason this matters in my case is that I have some class overrides
> in
> >>> one of my child poms (multi-module project).  Its important that my
> child
> >>> artifact with the overrides gets added to the classpath first.  I don't
> >>> know
> >>> what logic surefire uses to know what order to use but in the case of
> >>> site-deploy it is putting the original before my override.
> >>>
> >>> I want to be able to specify the jar class loading order surefire uses
> >>> (like
> >>> I could do in a war for instance at runtime).  How can I do this with
> >>> surefire?
> >>>
> >>> -Dave
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>

Re: Surefire: How to specify jar class loading order?

Posted by David Hoffer <dh...@gmail.com>.
I just verified, all our builds are using 2.1.0.

-Dave

On Mon, Aug 3, 2009 at 7:18 PM, David Hoffer <dh...@gmail.com> wrote:

> No, I'm using 2.1x.
>
> -Dave
>
>
> On Mon, Aug 3, 2009 at 4:22 PM, Stephen Connolly <
> stephen.alan.connolly@gmail.com> wrote:
>
>> I am going to guess that you are using a version of maven < 2.0.9
>>
>> if I am wrong, let us know
>>
>> Sent from my [rhymes with myPod] ;-)
>>
>>
>> On 3 Aug 2009, at 23:04, David Hoffer <dh...@gmail.com> wrote:
>>
>>  I have found a case where mvn install & deploy work fine but site-deploy
>>> does not.  The reason is that during site-deploy the surefire plugin is
>>> building a class loading list in the surefirebooter jar's Manifest that
>>> is
>>> different.
>>>
>>> The reason this matters in my case is that I have some class overrides in
>>> one of my child poms (multi-module project).  Its important that my child
>>> artifact with the overrides gets added to the classpath first.  I don't
>>> know
>>> what logic surefire uses to know what order to use but in the case of
>>> site-deploy it is putting the original before my override.
>>>
>>> I want to be able to specify the jar class loading order surefire uses
>>> (like
>>> I could do in a war for instance at runtime).  How can I do this with
>>> surefire?
>>>
>>> -Dave
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>

Re: Surefire: How to specify jar class loading order?

Posted by David Hoffer <dh...@gmail.com>.
No, I'm using 2.1x.

-Dave

On Mon, Aug 3, 2009 at 4:22 PM, Stephen Connolly <
stephen.alan.connolly@gmail.com> wrote:

> I am going to guess that you are using a version of maven < 2.0.9
>
> if I am wrong, let us know
>
> Sent from my [rhymes with myPod] ;-)
>
>
> On 3 Aug 2009, at 23:04, David Hoffer <dh...@gmail.com> wrote:
>
>  I have found a case where mvn install & deploy work fine but site-deploy
>> does not.  The reason is that during site-deploy the surefire plugin is
>> building a class loading list in the surefirebooter jar's Manifest that is
>> different.
>>
>> The reason this matters in my case is that I have some class overrides in
>> one of my child poms (multi-module project).  Its important that my child
>> artifact with the overrides gets added to the classpath first.  I don't
>> know
>> what logic surefire uses to know what order to use but in the case of
>> site-deploy it is putting the original before my override.
>>
>> I want to be able to specify the jar class loading order surefire uses
>> (like
>> I could do in a war for instance at runtime).  How can I do this with
>> surefire?
>>
>> -Dave
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Surefire: How to specify jar class loading order?

Posted by Stephen Connolly <st...@gmail.com>.
I am going to guess that you are using a version of maven < 2.0.9

if I am wrong, let us know

Sent from my [rhymes with myPod] ;-)

On 3 Aug 2009, at 23:04, David Hoffer <dh...@gmail.com> wrote:

> I have found a case where mvn install & deploy work fine but site- 
> deploy
> does not.  The reason is that during site-deploy the surefire plugin  
> is
> building a class loading list in the surefirebooter jar's Manifest  
> that is
> different.
>
> The reason this matters in my case is that I have some class  
> overrides in
> one of my child poms (multi-module project).  Its important that my  
> child
> artifact with the overrides gets added to the classpath first.  I  
> don't know
> what logic surefire uses to know what order to use but in the case of
> site-deploy it is putting the original before my override.
>
> I want to be able to specify the jar class loading order surefire  
> uses (like
> I could do in a war for instance at runtime).  How can I do this with
> surefire?
>
> -Dave

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