You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dale Peakall <da...@fdisolutions.com> on 2005/11/11 10:37:49 UTC

Test cases that rely on build artifacts being Jars

Hi All,

I'm trying to set-up Maven 2 to build a rather unusual project and am 
struggling.

The project is a multi-module project.  There's a core library and some 
modules that depend on the core library.  These modules are some test 
'plugins' - and here is where my problems lie.

The plugins are Jars that the core library will use.  In order to run 
the core libraries test suite it needs to be able load these libraries 
using either ClassLoader.getResource, Class.getResource or 
ClassLoader.getSystemResource.

When using Ant, the build process followed the following steps:
   o Compile the core library
   o Compile the plugins and create the Jars
   o Copy the Jars into a directory on the system class-path
     (so they can be accessed using ClassLoader.getSystemResource)
   o Run the core library test-suite

I've separated out the core libraries test-suite into a separate module 
to avoid a 'circular' dependency (the plugins have a compile dependency 
on the core library; the core-library has a test dependency on the 
plugins).  The plugins now depend on the core library and the core 
library test suite depends on the plugins.

I've also added the maven-jar-plugin to the 'process-test-resources' 
life-cycle phase of the plugins so that the jars get built.

What I can't do is work out how to get the plugin jars into a location 
that can be reached by the core libraries test suite.  Any help appreciated.

Thanks in advance.

	- Dale.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Test cases that rely on build artifacts being Jars

Posted by Brett Porter <br...@gmail.com>.
> I've separated out the core libraries test-suite into a separate module
> to avoid a 'circular' dependency (the plugins have a compile dependency
> on the core library; the core-library has a test dependency on the
> plugins).  The plugins now depend on the core library and the core
> library test suite depends on the plugins.

Great!

>
> What I can't do is work out how to get the plugin jars into a location
> that can be reached by the core libraries test suite.  Any help appreciated.

If they are dependencies of the test suite they will be in the same
classloader as the test suite already - this doesn't work?

Cheers,
Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org