On 8/17/06, Nick Veys <[EMAIL PROTECTED]> wrote:
On 8/16/06, Denis McCarthy <[EMAIL PROTECTED]> wrote:
>
> Hi,
> One of my projects depends on a second project. As a result, I've
> defined the first project as being packaged as a pom, with an associated
> dependency in the second package. However, when I run 'mvn test' on the
> pom packaged project no tests are run (which I think is normal for
> pom-packaged projects with no modules). What should I do to run tests
> for a pom packaged project - do I really require a module? Indeed, am I
> approaching maven intra-project dependency management skew-ways?
> TIA
> Denis
What about the project depends on the previous project? If it's just
a code dependency then you shouldn't use it as a parent POM. If there
are common project attributes to the two projects, then make a
separate parent-pom with those attributes, and have both extend it.
As Nick says these should both be packaged as jars with one module
depending on the other module.
A module is just a convenient way to run a single maven command across
conceptually related projects. To achive this you must follow the
maven standard project structure of
root
- pom.xml
- module1
- pom.xml
- module2
- pom.xml
Where the root pom defines the modules.
However defining a module does not introduce any dependencies between
the projects.
Thus you must define the dependencies for each project (a module is
just a project too).
Remember maven does not depend upon source, it depends upon installed
artifacts in the repository. So if module2 depends upon module1, you
must run mvn install in the module1 directory before you can run mvn
install in the module2 directory. Alternatively, as a convenience, if
you have set up your project as modules you can run mvn install at the
root directory and maven will build your projects in the order as
defined in the module list, saving you the need to run the install
command twice.
Hope that helps.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]