You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Chris von See <ch...@techadapt.com> on 2009/12/24 22:46:26 UTC

Building project dependencies under Maven Eclipse plugin

I have an application that is comprised of three Maven projects: a  
server, a webapp and a common JAR.  All three of these have the same  
parent POM, and the server and webapp have the appropriate  
dependencies defined.  When I execute "mvn clean install" on the  
parent POM from the command line everything gets built in the correct  
order and with no problems, so I'm pretty comfortable that the POMs  
are set up correctly.

Now, I'd like to use the Maven Eclipse plugin and the Maven "exec- 
maven-plugin' with the exec:java goal to run and debug a child project  
under Eclipse.  As I understand it, I need to set the working  
directory of the Eclipse debug configuration to the base directory of  
the child project (the server, for example) so that the Maven Eclipse  
plugin will find the child project's POM.  However, when I do this  
then the Maven Eclipse plugin doesn't rebuild any of the other child  
projects under that parent if changes are made to their sources during  
the debugging session.  Given what I've read of Maven this seems to  
make sense, but I'm wondering if there's a way to tell the Maven  
Eclipse plugin to execute the clean/install against the parent's POM  
before running the child project using exec-maven-plugin.  Is this  
possible? and if so, what do I need to do?


Thanks
Chris




Re: Building project dependencies under Maven Eclipse plugin

Posted by Barrie Treloar <ba...@gmail.com>.
On Fri, Dec 25, 2009 at 8:16 AM, Chris von See <ch...@techadapt.com> wrote:
> I have an application that is comprised of three Maven projects: a server, a
> webapp and a common JAR.  All three of these have the same parent POM, and
> the server and webapp have the appropriate dependencies defined.  When I
> execute "mvn clean install" on the parent POM from the command line
> everything gets built in the correct order and with no problems, so I'm
> pretty comfortable that the POMs are set up correctly.
>
> Now, I'd like to use the Maven Eclipse plugin and the Maven
> "exec-maven-plugin' with the exec:java goal to run and debug a child project
> under Eclipse.  As I understand it, I need to set the working directory of
> the Eclipse debug configuration to the base directory of the child project
> (the server, for example) so that the Maven Eclipse plugin will find the
> child project's POM.  However, when I do this then the Maven Eclipse plugin
> doesn't rebuild any of the other child projects under that parent if changes
> are made to their sources during the debugging session.  Given what I've
> read of Maven this seems to make sense, but I'm wondering if there's a way
> to tell the Maven Eclipse plugin to execute the clean/install against the
> parent's POM before running the child project using exec-maven-plugin.  Is
> this possible? and if so, what do I need to do?

Do you mean m2eclipse of the maven-eclipse-plugin?

If you mean maven-eclipse-plugin , then running it is a once-off thing.
You only need to re-run it if the dependencies change - you do not
need to re-run it if you change your source.

Think of the eclipse plugin as an automated way of configuring things
you would do manually in eclipse yourself.

The first thing you should do is to make sure that you can get what
you are doing working in eclipse manually.
Then create a copy of that structure and attempt the same thing via
the maven eclipse plugin and keep tweaking until you get them to be
the same.

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