Using profiles did the trick and got me over the hump with the first round
of testing, but now I find myself in the following situation:

The ClassLoader I ended up writing extends URLClassLoader so that it can
dynamically load class files from the same jar that contains it by
programatically scanning relevant packages for certain types of interesting
classes, the names of which should not in principle need to be known at
compile-time. So far, so good.

But since the Tests I need to run against that ClassLoader depend upon the
pre-existence of the jar file that contains it, I've had to disable the test
to get the jar artifact, then go back and test against the re-enabled test
code from within my IDE.

Can I do some assembly pre-packaging (or something?) by adding executions to
something like test-compile? Or do a test-disabled package step before
running tests before packaging?

It's all somewhat circular, I realize, but the only other way I can think to
deal with it is to pull my project apart into two...

JPN


On Mon, Apr 7, 2008 at 2:21 PM, Andreas Guther <
[EMAIL PROTECTED]> wrote:

> Did you try to use different profiles?
>
> Andreas
>
>
> -----Original Message-----
> From: Jason Nerothin [mailto:[EMAIL PROTECTED]
> Sent: Monday, April 07, 2008 12:14 PM
> To: users@maven.apache.org
> Subject: classloader testing
>
> I've written a basic ClassLoader and can test it to my satisfaction by
> flipping the attribute for <project>/src/main/java to "test source" (in
> my
> IDE) so that the test-configured ClassLoader  can get to the classes I
> need
> to test. Later on, I use my IDE to set it back to "plain old source"
> when
> all of my <project>/src/test/java tests have been passed. When I want to
> run
> the method than needs the ClassLoader, I fire up my class containing
> main(...), and everything works appropriately.
>
> The question is, how do I configure my pom to do a similar thing so that
> I'm
> not dependent upon my IDE at package-time?
>
> JPN
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to