Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Commons Wiki" for 
change notification.

The "MavenGroupIDChange" page has been changed by sebbapache.
The comment on this change is: Add classpath notes.
http://wiki.apache.org/commons/MavenGroupIDChange?action=diff&rev1=1&rev2=2

--------------------------------------------------

  
  Assume also that there is a Bar application which depends on two libraries, 
lib1 and lib2.
  lib1 depends on commons-foo:commons-foo:1 and lib2 depends on 
commons-foo:commons-foo:2.
+ 
+ == Classpath considerations ==
+ 
+ The Java classpath can contain multiple versions of the same classname (in 
different jars or directories).
+ However, at most one version of a given class can be loaded into a single 
class-loader.
+ 
+ So if a class is updated such that its API is no longer backwards-compatible, 
it's not possible to use both in the same classpath.
+ The only solution is to change the class name, e.g. by changing its package 
name - or one could change just the classname.
+ [In both of these cases the code could be made compatible again by keeping 
the original code alongside the new. However, at some point the old code will 
probably need to be deleted, at which time the versions will be incompatible 
anyway.]
+ 
+ If there are multiple versions of the same class on the classpath, there's no 
guarantee which version will be loaded, 
+ so in general the classpath should only ever contain a single version of each 
class.
  
  == Maven dependency resolution ==
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to