Maven Surefire

Remove use of parent classloader in surefirebooter but keep TestNG support working

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 2.3
  • Fix Version/s: 2.3
  • Component/s: None
  • Labels:
    None
  • Complexity:
    Intermediate
  • Number of attachments :
    0

Description

The removal of the parent system classloader while running tests in surefire booter totally broke testNG support.

I am going to revert the commit:
http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireBooter.java?r1=427040&r2=438999&diff_format=h
... in order to keep testng working for now, but we should find a way to solve both problems soon.

The removal of the parent classloader is needed, according to Kenney for the following reason:
If this is not done, the System classloader is added, in this case an AppClassloader containing everything in the root classpath. For instance, in maven, everything in core/ is available.This can cause clashes with the plexus-utils used in maven itself.

Activity

Hide
Milos Kleint added a comment -

when maven is embedded in another application, the System classloader can contain also other stuff from the embedding application.

Show
Milos Kleint added a comment - when maven is embedded in another application, the System classloader can contain also other stuff from the embedding application.
Hide
Kenney Westerhof added a comment -

Fixed in revision 441092; reapplied my change and made surefireclassloader a child
of testclassloader, solving all classloading issues.

Show
Kenney Westerhof added a comment - Fixed in revision 441092; reapplied my change and made surefireclassloader a child of testclassloader, solving all classloading issues.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: