On Fri, Sep 30, 2011 at 12:42 AM, GustavoR
<[email protected]> wrote:
> Hi to everyone. That's is my first post..
>
> I have a big multi-module project
>
> Suppose that project structure:
>
> MainModule
>   |_ Module1
>   |     |_ SubModule1
>   |_ Module 2
>         |_SubModule2
>
> And SubModule2 has a dependency with SubModule1. Is there any way to run mvn
> test in Submodule2 forcing the generation of SubModule1 and its dependents
> if it have. I dont have SubModule1 installed in my local repository.. so mvn
> test in Submodule2 fails.

As this is your first post, I'll remind you that having a subject line
like "Help!" will often generate no response.
Please read http://catb.org/~esr/faqs/smart-questions.html
You are lucky that Wayne has replied.

Now, to answer the question.

Have you tried?
  mvn -h

At the root level, you can run
  mvn --also-make -pl Module2/SubModule2 test

This will also build any projects that SubModule2 depends upon.

An alternative is to setup your IDE correctly.

If you have your IDE setup correctly (e.g. Eclipse) then for most of
the time you can make your changes there, and run the unit tests
inside Eclipse.
As each project will be configured to depend upon the other projects
it needs inside Eclipse you do not need to break out to a shell to run
Maven all the time.

You should run
  mvn clean install
just before you commit any changes to your repository to validate you
haven't broken any other things that Maven will do for you, that
Eclipse doesn't

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to