Don't you think it's a bit weird to run the maven-compiler-plugin:compile
during the generate-sources phase? Try to keep this as they were meant to:-
generate sources during the generate-sources phase- compile the sources during
the compile phase.(within a few months you won't understand this anymore,
neither will your fellow developers)Another question: is Main a class of the
plugin or from the project using the plugin? Sounds like you are trying to
solve a chicken-egg problem... -Robert > Date: Sun, 17 Jul 2011 11:20:32 -0700
> Subject: Re: How to load a class in a Mojo?
> From: hilco.wijbe...@gmail.com
> To: users@maven.apache.org
>
> On 17 July 2011 02:53, Robert Scholte <rfscho...@codehaus.org> wrote:
> > It is less complex, it´s just like any other
> > java-project:this.getClass().getResourceAsStream( name )
> > this.getClass().getResource( name );
>
> That's what I started with but both give me a NULL.
>
> Just to make sure I've given you all (possibly irrelevant)
> information, here's the full scoop:
>
> 1. In generate-sources, my plugin runs the maven-compiler-plugin to
> compile Main.java (this works fine);
> 2. It then tries to load Main.class. This does not work, even though
> Main.class exists and is on the class path. I get NULLs and
> ClassNotFoundExceptions.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>