List Info

Thread: exporting classworlds or testing assembly output




exporting classworlds or testing assembly output
country flaguser name
United States
2007-08-30 17:10:06
Hello,

I have a unit test which tests a shell script. This shell
script  
calls java code, so it fails under Maven, because the java
coded  
launched by the shell script doesn't have a complete
classpath. I can  
work around this by using <useSystemClassloader>, but
it turns out  
this was breaking my embedded tomcat.

So I'm wondering, is there any way to export Maven's
classworlds  
configuration through an environment variable so I can call 

System.exec() on some java code and have it work?

If not (and this would actually be preferable), is there any
way in  
Maven to run tests on an assembly (or other distributable)?
If I  
could do that, I could write tests and have them test a
fully built  
distributable, which would let the shell scripts assemble
the  
classpath the same way we do in production, which would make
the test  
much more realistic.

Thanks for any suggestions,

Josh


-- 
Joshua ChaitinPollak
Software Engineer
Kiva Systems



------------------------------------------------------------
---------
To unsubscribe, e-mail: users-unsubscribemaven.apache.org
For additional commands, e-mail: users-helpmaven.apache.org


Re: exporting classworlds or testing assembly output
country flaguser name
United Kingdom
2007-08-30 17:14:04
Joshua ChaitinPollak wrote:

> If not (and this would actually be preferable), is
there any way in 
> Maven to run tests on an assembly (or other
distributable)? If I could 
> do that, I could write tests and have them test a fully
built 
> distributable, which would let the shell scripts
assemble the classpath 
> the same way we do in production, which would make the
test much more 
> realistic.

In our case we try and avoid classpath hell as much as we
can by 
creating uberjars of all our executable code. Uberjars are
self 
contained jars with all dependencies included, we don't need
to worry 
about classpaths anywhere.

We use the assembly plugin to create a jar-with-dependencies
uberjar to 
do this.

Regards,
Graham
--
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )