Martin,

 

Unfortunately, we are overriding classes from a dependency library, so we
are just putting the classes in the same package and wanting our overriding
classes to get precedence on the classpath.  So, our classes are in the same
package as the library's classes and have the same class name, we just want
ours to be used at compile time.

 

Thanks,  

 

Brendan Haverlock

 

From: Martin Gainty [mailto:mgai...@hotmail.com] 
Sent: Thursday, May 21, 2009 6:15 PM
To: brend...@mirthcorp.com
Subject: RE: Override dependency classes with another module's classes

 


public interface ModuleC {
 public int doCalculationC(int a)
 {
   return(a+1);
  }
}
public class ModuleA implements ModuleC {
 public int doCalculationA(int a)
 {
   return (a+2);
 }
 public int doCalculationC(int a)
 {
   return(a+1);
  }
}
1. I have a Module A that is overriding a few, but not all, classes from its
> Dependency C.
//B extends A and all protected/public methods from A
//B implements C and all protected/public methods from C
public class ModuleB extends ModuleA implements ModuleC
{
  public int doCalculationB(int a)
  {
    return (a+3);
  }
public int doCalculationA(int a)
 {
   return (a+2);
 }
 public int doCalculationC(int a)
 {
   return(a+1);
  }
}

> 2. I have another Module B that is dependent on Module A, but also on the
> Dependency C.
> 3. Module B is getting compile errors because it is using the classes from
> Dependency C but not finding the overridden classes from Module A.


> From: brend...@mirthcorp.com
> To: users@maven.apache.org
> Subject: Override dependency classes with another module's classes
> Date: Thu, 21 May 2009 17:39:46 -0700
> 
> Hi all,
> 
> I've run into an issue with my dependencies in Maven:
> 
> 1. I have a Module A that is overriding a few, but not all, classes from
its
> Dependency C.
> 2. I have another Module B that is dependent on Module A, but also on the
> Dependency C.
> 3. Module B is getting compile errors because it is using the classes from
> Dependency C but not finding the overridden classes from Module A.
> 
> Question: Is there a way for me to specify dependency precedence so that
> Module B knows to use the classes from Dependency C, except for the ones
> that were overridden in Module A?
> 
> Thanks,
> Brendan Haverlock
> 
> 
> 

  _____  

Insert movie times and more without leaving HotmailR. See how.
<http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutor
ial_QuickAdd1_052009> 

Reply via email to