[ http://jira.codehaus.org/browse/MEXEC-14?page=all ]
Jerome Lacoste closed MEXEC-14. ------------------------------- Assignee: Jerome Lacoste Resolution: Fixed Fix Version/s: 1.1 Checked in. > Don't have plugin's classloader on classpath for executed code > -------------------------------------------------------------- > > Key: MEXEC-14 > URL: http://jira.codehaus.org/browse/MEXEC-14 > Project: Mojo Exec Plugin > Issue Type: Improvement > Affects Versions: 1.1 > Reporter: David Smiley > Assigned To: Jerome Lacoste > Priority: Minor > Fix For: 1.1 > > Attachments: dsmiley_2785.diff > > > The plugin was using a special ClassLoader (IsolatedClassLoader) which it > defined, and the parent ClassLoader was set to that of the plugin (i.e. > Maven's ClassLoader). I don't think that is desired, we want to pretend Java > is being invoked from the command-line free of Maven (at least that's the > illusion). We also want to do child-first delegation to be consistent with > Java. So I swapped out IsolatedClassLoader with a simple application of > URLClassLoader. Less code -- a good thing. Fixing this, however, revealed > some bugs in the testing environment which relied on the former (wrong) > behavior: > * I needed to ensure that the test classpath of the plugin got onto the > classpath of the pom being tested. It wasn't there before but should have > been. This isn't strictly necessary but lets our tests remain easy by having > test poms refer to a mainclass that's in exec plugin's test sources. That > was relatively easy to do by on the fly modifying the outputDirectory > configuration element to be that of the test classes output of exec plugin. > That worked. > * The test file ExecMojoArgsTest was broken and could not be easily fixed in > place, if at all (it used MavenEmbedder). I re-wrote that test and > incorporated the rewrite into ExecJavaMojoTest and then I deleted > ExecMojoArgsTest (with permission from Philippe Jacot). > In the attached patch, I also cleaned up lingering issues from MEXEC-6 a tad: > * logging some things that aren't a problem at debug and not higher > * remembered to destroy the ThreadGroup now > * fixed bug where System properties should be stored prior to modification -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email