You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Salgar, Mehmet (external)" <me...@external.telekom.de> on 2010/11/05 12:06:18 UTC

Replacing classes in a jar after bug fixes - patches

Hi everybody,

I have a question about how to replace a class in a dependency jar after
a bug fix....

I made a fix for a class in a framework that is not developed from us,
now during our build process I like to place patched class inside of
original dependency....

So my question is there a maven plugin for this purpose....I know, I can
do this with maven ant plugin but I hoping may be there is a better
way...

Thx for the answers....


Telekom Deutschland GmbH 
Aufsichtsrat: Timotheus Hottges (Vorsitzender) 
Geschaftsfuhrung: Niek Jan van Damme (Sprecher), Thomas Berlemann, Thomas Dannenfeldt,
Thomas Freude, 
Friedrich Fu?, Christoph Ganswindt, Dr. Christian P. Illek, Dr. Bruno Jacobfeuerborn, Dietmar Welslau 
Handelsregister: Amtsgericht Bonn, HRB 59 19 
Sitz der Gesellschaft: Bonn 
WEEE-Reg.-Nr.: DE60800328

Re: Replacing classes in a jar after bug fixes - patches

Posted by Graham Leggett <mi...@sharp.fm>.
On 05 Nov 2010, at 2:20 PM, Barrie Treloar wrote:

> On Fri, Nov 5, 2010 at 9:36 PM, Salgar, Mehmet (external)
> <me...@external.telekom.de> wrote:
>> Hi everybody,
>>
>> I have a question about how to replace a class in a dependency jar  
>> after
>> a bug fix....
>>
>> I made a fix for a class in a framework that is not developed from  
>> us,
>> now during our build process I like to place patched class inside of
>> original dependency....
>>
>> So my question is there a maven plugin for this purpose....I know,  
>> I can
>> do this with maven ant plugin but I hoping may be there is a better
>> way...
>
> The short answer is, No.
> Doing it that way is just asking for a world of pain.
>
> The correct way is to provide the patch back to the original project
> and then get a new release cut.
>
> While you wait for that to happen, create an internal release of that
> project that contains your patch.
> Following something like
> http://docs.codehaus.org/display/MAVENUSER/Patching+Maven+Plugins
> (but it will be simpler since you are not patching a plugin)

I can't stress the pain this causes enough.

It's bad enough when you're forced to get a version of production code  
up and running to fix a bug. When that code suddenly exhibits a new  
bug, because the magic version of some nameless jar is suddenly  
different, but it's completely impossible to tell they are different,  
you risk losing the will to live.

Please, don't do it.

Regards,
Graham
--


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


Re: Replacing classes in a jar after bug fixes - patches

Posted by Barrie Treloar <ba...@gmail.com>.
On Fri, Nov 5, 2010 at 9:36 PM, Salgar, Mehmet (external)
<me...@external.telekom.de> wrote:
> Hi everybody,
>
> I have a question about how to replace a class in a dependency jar after
> a bug fix....
>
> I made a fix for a class in a framework that is not developed from us,
> now during our build process I like to place patched class inside of
> original dependency....
>
> So my question is there a maven plugin for this purpose....I know, I can
> do this with maven ant plugin but I hoping may be there is a better
> way...

The short answer is, No.
Doing it that way is just asking for a world of pain.

The correct way is to provide the patch back to the original project
and then get a new release cut.

While you wait for that to happen, create an internal release of that
project that contains your patch.
Following something like
http://docs.codehaus.org/display/MAVENUSER/Patching+Maven+Plugins
(but it will be simpler since you are not patching a plugin)

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