You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by GustavoR <ro...@gmail.com> on 2011/09/29 17:12:15 UTC
Help!
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.
Tanks in advance
Gustavo
--
View this message in context: http://maven.40175.n5.nabble.com/Help-tp4853497p4853497.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Help!
Posted by Wayne Fay <wa...@gmail.com>.
> if i run mvn test in MainModule it will compile and run all child modules
> and their tests. If it possible to run only one submodule's tests?
Not that I am aware of. I would use TestNG and groups to accomplish this task.
See the second answer here from tunaranch:
http://stackoverflow.com/questions/1873995/run-a-single-test-method-with-maven
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Help!
Posted by GustavoR <ro...@gmail.com>.
Thanks for your quick reply
That is what i supposed :( .
Let me ask you another question
if i run mvn test in MainModule it will compile and run all child modules
and their tests. If it possible to run only one submodule's tests?
Thanks again
--
View this message in context: http://maven.40175.n5.nabble.com/Help-tp4853497p4853680.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Help!
Posted by Wayne Fay <wa...@gmail.com>.
> 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.
Not if you run mvn test from SubModule2.
This only works if you run mvn test from MainModule (the top parent).
The reactor will determine via the dependency graph that it needs to
build SubModule1 first, then make that newly-built artifact available
to SubModule2.
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Help!
Posted by GustavoR <ro...@gmail.com>.
Thanks in advance
It works!!
I'll adopt your advices for next posts
2011/9/29 Barrie Treloar [via Maven] <ml...@n5.nabble.com>:
> On Fri, Sep 30, 2011 at 12:42 AM, GustavoR
> <[hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://maven.40175.n5.nabble.com/Help-tp4853497p4854981.html
> To unsubscribe from Help!, click here.
--
View this message in context: http://maven.40175.n5.nabble.com/Help-tp4853497p4857945.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Re: Help!
Posted by Barrie Treloar <ba...@gmail.com>.
On Fri, Sep 30, 2011 at 12:42 AM, GustavoR
<ro...@gmail.com> 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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org