[ http://jira.codehaus.org/browse/MEXEC-9?page=all ]

Jerome Lacoste closed MEXEC-9.
------------------------------

    Resolution: Fixed

Fixed as part of MEXEC-14

> PATCH: IsolatedClassLoader is not actually isolated
> ---------------------------------------------------
>
>                 Key: MEXEC-9
>                 URL: http://jira.codehaus.org/browse/MEXEC-9
>             Project: Mojo Exec Plugin
>          Issue Type: Bug
>    Affects Versions: 1.0.1, 1.0.2
>            Reporter: Matt Whitlock
>         Assigned To: Jerome Lacoste
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: exec-maven-plugin.patch
>
>
> The IsolatedClassLoader defined in ExecJavaMojo breaks applications.  An 
> example demonstrating this breakage is an application that uses the 
> XMLDecoder class of the J2SE, and whose project includes a dependency on a 
> newer version of xml-apis than included in the JRE.
> Expected Results:
> The exec:java goal should use a classloader that first attempts to locate 
> classes in the dependency artifacts of the project, and then delegates to the 
> system class loader if unsuccessful.  This is analogous to starting a Java 
> app with the command line "java -cp dep1.jar:dep2.jar:... MainClass".  This 
> is the behavior that is intuitively expected of the exec:java goal.
> Actual Results:
> The exec:java goal uses a locally defined (and not completely implemented) 
> IsolatedClassLoader that first searches the dependencies of the project and 
> then delegates to the classloader that loaded the mojo.  This behavior adds 
> undesired delegation to the classloader used to start the application, which 
> causes class and resource conflicts.
> Proposed Solution:
> Simply load the main class of the application using a URLClassLoader 
> configured to search the project's dependencies and fall back on the system 
> class loader.  This proposed solution is implemented by the attached patch.
> Known Issues:
> The solution breaks the ExecJavaMojoTest unit test because that test case 
> attempts to load a main class (DummyMain) that is defined inside the 
> exec-maven-plugin, which is not actually a dependency of the mock Maven 
> project that the test sets up.

-- 
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

Reply via email to