You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mike Craig <mk...@gmail.com> on 2012/06/19 01:27:21 UTC

Plugins and multi-module projects

I'm trying to use the exec-maven-plugin to run a main class in a
multi-module project. The main class is in module2, which is dependent on
module1. So far the only way I've been able to do this is:

    mvn install
    cd module2
    mvn exec:java -Dexec.mainClass=MyMainClass

But I shouldn't have to modify my local repository to run a goal in a
self-contained project. I should be able to do this without installing,
like so (from the top of the project):

    mvn compile
    mvn exec:java -Dexec.mainClass=MyMainClass

Is this possible?

More generally, is it possible (from a plugin) for one module to use
another module without installing?

Cheers,
Mike

Re: Plugins and multi-module projects

Posted by Aliaksei Lahachou <al...@googlemail.com>.
Try mvn -pl module2 -am exec:java -Dexec.mainClass=MyMainClass from the
root directory.


Regards,
htfv (Aliaksei Lahachou)


On Tue, Jun 19, 2012 at 1:27 AM, Mike Craig <mk...@gmail.com> wrote:

> I'm trying to use the exec-maven-plugin to run a main class in a
> multi-module project. The main class is in module2, which is dependent on
> module1. So far the only way I've been able to do this is:
>
>    mvn install
>    cd module2
>    mvn exec:java -Dexec.mainClass=MyMainClass
>
> But I shouldn't have to modify my local repository to run a goal in a
> self-contained project. I should be able to do this without installing,
> like so (from the top of the project):
>
>    mvn compile
>    mvn exec:java -Dexec.mainClass=MyMainClass
>
> Is this possible?
>
> More generally, is it possible (from a plugin) for one module to use
> another module without installing?
>
> Cheers,
> Mike
>