List classpathFiles = project.getCompileClasspathElements();

         URL[] urls = new URL[classpathFiles.size() + 1];

         getLog().debug("" + classpathFiles.size());

         for (int i = 0; i < classpathFiles.size(); ++i) {
            getLog().debug((String)classpathFiles.get(i));
            urls[i] = new File((String)classpathFiles.get(i)).toURL();
         }

         urls[classpathFiles.size()] = new File( buildDirectory + "/classes"
).toURL();

         URLClassLoader ucl = new URLClassLoader(urls, Thread.currentThread
().getContextClassLoader());


this ought to get you going

jesse


On 12/20/05, Brian E. Fox <[EMAIL PROTECTED]> wrote:
>
> I had this same issue with a Kodo plugin I wrote. It seems the only way
> is to extend the class loader. I can send some code if you want to
> persue this option.
>
> -----Original Message-----
> From: Miguel Griffa [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 20, 2005 7:17 PM
> To: Maven Developers List
> Subject: m2 plugin classpath
>
> Hi all
>    I have an m2 plugin that neets to run using classes compiled from the
> project. I have added for this @execute phase=compile so the project
> gets compiled first, but I can't find a way to add the project classpath
> to the running plugin classpath, I have considered creating an new jvm
> or creating a classloader, but I think this 2 options are horrible,
> there must be a better way.
>    I'd really appreciate any feedback on this, thanks
>
> --
> Miguel Griffa
> Skype: miguel.griffa
> Y!: m_griffa
> MSN: [EMAIL PROTECTED]
> Cell: 54-911-62519355
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
jesse mcconnell
jesseDOTmcconnellATgmailDOTcom

Reply via email to