You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Piyush Gupta <pg...@gmail.com> on 2009/09/26 00:41:34 UTC

Building Multiple Eclipse with Maven

I have configured Multiple project in my eclipse workspace and each project
has its own POM.XML . I have worked with the dependencies with single
eclipse project with multiple modules in that single project and it works
fine when build with Maven but when working with Different projects is there
any possibility to build the all the project with one single parent project?
I do not want to build all the dependent project and install the JAR in
local repository and than build the parent project I know that will work
fine. What I want to achieve is with out building the dependent project I
will just build the Parent Project and it will build all the dependent
project plus all the Third party JAR's which every project is having and put
it into the local repo and every project's respective target directory.

 

The project structure in eclipse is like this

 

C:\eclipse\workspace

                  \ ProjectA  

                  |

                  pom.xml

                  |

                  src.com.javasource      

            

              \ ProjectB (Child)

                  |

                  pom.xml

                  |

                  src.com.javasource

            

             \ ProjectC 

                  |

                  pom.xml

                  |

                  src.com.javasource

 

So when I will compile or run the command on ProjectA 's pom.xml it should
build the ProjectB and ProjectC and create the projectb.jar and projectc.jar
and put those jar's into the respective projects target directory.

 


Re: Building Multiple Eclipse with Maven

Posted by Barrie Treloar <ba...@gmail.com>.
On Mon, Sep 28, 2009 at 10:58 PM, Daniel Kulp <dk...@apache.org> wrote:
> That said, you DO need to tell it where your workspace is.    You can use the
> -D flag on the command line if you want.   For me, I added a activeProfile to
> my settings.xml:
>
>    <activeProfiles>
>        <activeProfile>extra</activeProfile>
>    </activeProfiles>
>       <profile>
>            <id>extra</id>
>            <properties>
>                <eclipse.workspace>/home/dkulp/working/workspace</eclipse.workspace>
>            </properties>
>        </profile>

That's neat.

I've always been wondering how I can have custom flags for
non-lifecycle plugins.

I'm off to tinker with downloadJavadocs and downloadSources on as default...

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


Re: Building Multiple Eclipse with Maven

Posted by Jason van Zyl <ja...@sonatype.com>.
On 2009-09-28, at 6:28 AM, Daniel Kulp wrote:

> On Sun September 27 2009 5:37:24 pm Jason van Zyl wrote:
>> On 2009-09-27, at 2:08 PM, Roland Asmann wrote:
>>> Again, the way we work DOES have real workspace resolution. The
>>> maven-eclipse-plugin makes the projects in the reactor reference  
>>> each
>>> other PER DEFAULT, and any other projects in the workspace if you
>>> tell it
>>> to.
>>
>> I just ran it on a project and that's not what it did. I'm not  
>> talking
>> only about multi-module projects but other projects you may refer to.
>> I'm often working on several related projects where I need to work
>> with them all at the same time.
>>
>>> I'm not trying to tell anybody not to use M2Eclipse or anything, I
>>> just
>>> want to state that it is not correct to say that you can't use the
>>> plugin
>>> if you want workspace resolution.
>>
>> For inter-project resolution it is. For intra-project (i.e. multi-
>> module) is does.
>

The problem is the default configuration. When I just ran it by  
default it does not linking, so the chances that a new user is going  
to get this right the first time is highly unlikely. These are the  
problems we run into.

That said, I'm not saying don't use the maven-eclipse-plugin, I'm  
saying we're not going support it working with M2Eclipse. The  
workspace linking is only one of the potential interoperability  
problems. The maven-eclipse-plugin may do all sorts of things but if  
they require additional configuration and don't work by default the  
likelihood of success is greatly reduced.

> The maven-eclipse-plugin does a great job of wiring inter-project  
> things
> together.   If someone files a bug report with a maven based test  
> case, it's
> great cause I just need to do "mvn eclipse:eclipse" and it's all  
> wired up to
> the projects I already have in my workspace so debugging is quick  
> and easy.
>
> That said, you DO need to tell it where your workspace is.    You  
> can use the
> -D flag on the command line if you want.   For me, I added a  
> activeProfile to
> my settings.xml:
>
>   <activeProfiles>
>       <activeProfile>extra</activeProfile>
>   </activeProfiles>
>      <profile>
>           <id>extra</id>
>           <properties>
>               <eclipse.workspace>/home/dkulp/working/workspace</ 
> eclipse.workspace>
>           </properties>
>       </profile>
>
> So that the workspace location is always set and eclipse:eclipse can  
> always
> find it.
>
>
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------


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


Re: Building Multiple Eclipse with Maven

Posted by Daniel Kulp <dk...@apache.org>.
On Sun September 27 2009 5:37:24 pm Jason van Zyl wrote:
> On 2009-09-27, at 2:08 PM, Roland Asmann wrote:
> > Again, the way we work DOES have real workspace resolution. The
> > maven-eclipse-plugin makes the projects in the reactor reference each
> > other PER DEFAULT, and any other projects in the workspace if you
> > tell it
> > to.
> 
> I just ran it on a project and that's not what it did. I'm not talking
> only about multi-module projects but other projects you may refer to.
> I'm often working on several related projects where I need to work
> with them all at the same time.
> 
> > I'm not trying to tell anybody not to use M2Eclipse or anything, I
> > just
> > want to state that it is not correct to say that you can't use the
> > plugin
> > if you want workspace resolution.
> 
> For inter-project resolution it is. For intra-project (i.e. multi-
> module) is does.

The maven-eclipse-plugin does a great job of wiring inter-project things 
together.   If someone files a bug report with a maven based test case, it's 
great cause I just need to do "mvn eclipse:eclipse" and it's all wired up to 
the projects I already have in my workspace so debugging is quick and easy. 

That said, you DO need to tell it where your workspace is.    You can use the 
-D flag on the command line if you want.   For me, I added a activeProfile to 
my settings.xml:

    <activeProfiles>                                                                
        <activeProfile>extra</activeProfile>                                        
    </activeProfiles>
       <profile>
            <id>extra</id>
            <properties>
                <eclipse.workspace>/home/dkulp/working/workspace</eclipse.workspace>
            </properties>
        </profile>

So that the workspace location is always set and eclipse:eclipse can always 
find it.


-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

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


Re: Building Multiple Eclipse with Maven

Posted by Roland Asmann <Ro...@cfc.at>.
> On Mon, Sep 28, 2009 at 7:07 AM, Jason van Zyl <jv...@sonatype.com>
> wrote:
>>
>> I just ran it on a project and that's not what it did. I'm not talking
>> only about multi-module projects but other projects you may refer to.
>> I'm often working on several related projects where I need to work with
>> them all at the same time.
>>
>>> I'm not trying to tell anybody not to use M2Eclipse or anything, I just
>>> want to state that it is not correct to say that you can't use the
>>> plugin
>>> if you want workspace resolution.
>>>
>>
>> For inter-project resolution it is. For intra-project (i.e.
>> multi-module) is does.
>
> useProjectReferences is on by default, which will include
> inter-project resolution.
>
> However the plugin needs to find your workspace in order for it to work.
> If your project is not located underneath your workspace then
> m-eclipse-p can not automatically find it for you (it just walks up
> the directory hierarchy looking for a valid workspace).
> In that case you need to specify the workspace with -Dworkspace

I just looked it up and with the -Dworkspace setting it should indeed
work. I must admit that I currently only work with one multi-module
project, but I am sure it works on the whole workspace since that part was
developed here in my company and donated to the plugin.

>
> I also work with the eclipse project name being the same as the artifact
> name.
> I'm not sure what m-eclipse-p does if they differ.
> I think I wrote some integration tests for this scenario, but YMMV.

That doesn't matter (according to my colleague, who wrote the original
code for it). Check the plugin details for more info, since there are a
couple of (minor) restrictions.

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



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


Re: Building Multiple Eclipse with Maven

Posted by Barrie Treloar <ba...@gmail.com>.
On Mon, Sep 28, 2009 at 7:07 AM, Jason van Zyl <jv...@sonatype.com> wrote:
>
> I just ran it on a project and that's not what it did. I'm not talking only about multi-module projects but other projects you may refer to. I'm often working on several related projects where I need to work with them all at the same time.
>
>> I'm not trying to tell anybody not to use M2Eclipse or anything, I just
>> want to state that it is not correct to say that you can't use the plugin
>> if you want workspace resolution.
>>
>
> For inter-project resolution it is. For intra-project (i.e. multi-module) is does.

useProjectReferences is on by default, which will include
inter-project resolution.

However the plugin needs to find your workspace in order for it to work.
If your project is not located underneath your workspace then
m-eclipse-p can not automatically find it for you (it just walks up
the directory hierarchy looking for a valid workspace).
In that case you need to specify the workspace with -Dworkspace

I also work with the eclipse project name being the same as the artifact name.
I'm not sure what m-eclipse-p does if they differ.
I think I wrote some integration tests for this scenario, but YMMV.

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


Re: Building Multiple Eclipse with Maven

Posted by Jason van Zyl <jv...@sonatype.com>.
On 2009-09-27, at 2:08 PM, Roland Asmann wrote:

>>
>> On 2009-09-27, at 1:40 PM, Roland Asmann wrote:
>>
>>>>
>>>> On 2009-09-27, at 6:59 AM, Nayan Hajratwala wrote:
>>>>
>>>>> if you're using the m2eclipse plugin, building project b will  
>>>>> force
>>>>> a build of project a... but all the jar files will be installed  
>>>>> into
>>>>> and resolved from your local maven repository (~/.m2/repository),
>>>>> not the target directory.
>>>>>
>>>>
>>>> The JARs will not be resolved from the local repository by  
>>>> default if
>>>> you are using M2Eclipse. They are resolved from the workspace which
>>>> is
>>>> one of the primary reasons for using M2Eclipse: the live management
>>>> of
>>>> your dependencies and being able to work with them as you would
>>>> expect
>>>> in Eclipse. It's when you use the maven-eclipse-plugin that you get
>>>> this un-live connection to the local repository which is an  
>>>> extremely
>>>> inefficient way to work.
>>>
>>> I disagree. I've been using the maven-eclipse-plugin ever since we
>>> started
>>> working with Maven and I have yet to be disappointed by it. A
>>> colleague
>>> wrote a rather nice tutorial on how to set up your workspace for  
>>> using
>>> Maven and the maven-eclipse-plugin.
>>> (http://maven.apache.org/plugins/maven-eclipse-plugin/examples/multi-module-projects.html
>>> )
>>>
>>
>> You are free to work however you like. I'll qualify what I said by
>> saying that from what I've observed having real workspace resolution
>> make developers more efficient then having to use the local  
>> repository
>> as a mediator. If you want to use the maven-eclipse-plugin and that
>> fits your development workflow that's cool. It's just not going to
>> work with M2Eclipse because we just have too many support issues an
>> there are no developers who work on both sides to create parity.
>
> Again, the way we work DOES have real workspace resolution. The
> maven-eclipse-plugin makes the projects in the reactor reference each
> other PER DEFAULT, and any other projects in the workspace if you  
> tell it
> to.
>

I just ran it on a project and that's not what it did. I'm not talking  
only about multi-module projects but other projects you may refer to.  
I'm often working on several related projects where I need to work  
with them all at the same time.

> I'm not trying to tell anybody not to use M2Eclipse or anything, I  
> just
> want to state that it is not correct to say that you can't use the  
> plugin
> if you want workspace resolution.
>

For inter-project resolution it is. For intra-project (i.e. multi- 
module) is does.

>>
>>> To be honest though, I haven't looked at m2eclipse in quite some  
>>> time
>>> (think years, not months), so it might be better than the
>>> maven-eclipse-plugin by now. But as long as thinks work for me, I
>>> don' t
>>> think I would switch.
>>>
>>
>> You are free to use whatever you like. We just can support
>> interoperability indefinitely so with the 1.0 of M2Eclipse mixed use
>> of the maven-eclipse-plugin and M2Eclipse will not be supported.
>>
>>>>
>>>> From the M2Eclipse side we are soon just going to raise a huge
>>>> warning to people using the maven-eclipse-plugin basically saying  
>>>> we
>>>> don't support any interoperability between files generated with the
>>>> maven-eclipse-plugin and properly importing projects into Eclipse
>>>> using M2Eclipse. It's just causing too many support issues.
>>>>
>>>> We are also not going to support the N:1 mapping of many Maven
>>>> projects to a single Eclipse project because that just destroys the
>>>> natural mapping of Maven to Eclipse projects. It also causes
>>>> seriously
>>>> problems because if you N Maven project where different plugins are
>>>> used in different projects we can't accurately run the lifecycle
>>>> correctly for each of those projects if you merge them all  
>>>> together.
>>>> In this case we have to run everything for all projects, or have to
>>>> do
>>>> some very unnatural things to preserve this mapping ourselves which
>>>> we
>>>> decided not to do. We decided to go the path of having one Eclipse
>>>> project for every Maven project and we'll correct any problems with
>>>> that model.
>>>>
>>>> Now that we have M2Eclipse synced up with Maven 3.x trunk and 3.x  
>>>> is
>>>> compatible with 2.x this is the way forward. At least if you want  
>>>> to
>>>> use M2Eclipse. We are now in a position to fix problems in Maven  
>>>> 3.x,
>>>> turn around and absorb those changes in M2Eclipse and patch  
>>>> anything
>>>> wrong in M2Eclipse
>>>>
>>>>> Not sure why you would want the jar files in your target
>>>>> directory... is there some sort of project specific reason for  
>>>>> this?
>>>>>
>>>>>
>>>>> ---
>>>>> Nayan Hajratwala
>>>>> http://agileshrugged.com
>>>>> http://twitter.com/nhajratw
>>>>> 734.658.6032
>>>>>
>>>>> On Sep 25, 2009, at 6:41 PM, Piyush Gupta wrote:
>>>>>
>>>>>> I have configured Multiple project in my eclipse workspace and  
>>>>>> each
>>>>>> project
>>>>>> has its own POM.XML . I have worked with the dependencies with
>>>>>> single
>>>>>> eclipse project with multiple modules in that single project  
>>>>>> and it
>>>>>> works
>>>>>> fine when build with Maven but when working with Different  
>>>>>> projects
>>>>>> is there
>>>>>> any possibility to build the all the project with one single  
>>>>>> parent
>>>>>> project?
>>>>>> I do not want to build all the dependent project and install the
>>>>>> JAR in
>>>>>> local repository and than build the parent project I know that  
>>>>>> will
>>>>>> work
>>>>>> fine. What I want to achieve is with out building the dependent
>>>>>> project I
>>>>>> will just build the Parent Project and it will build all the
>>>>>> dependent
>>>>>> project plus all the Third party JAR's which every project is
>>>>>> having and put
>>>>>> it into the local repo and every project's respective target
>>>>>> directory.
>>>>>>
>>>>>>
>>>>>>
>>>>>> The project structure in eclipse is like this
>>>>>>
>>>>>>
>>>>>>
>>>>>> C:\eclipse\workspace
>>>>>>
>>>>>>               \ ProjectA
>>>>>>
>>>>>>               |
>>>>>>
>>>>>>               pom.xml
>>>>>>
>>>>>>               |
>>>>>>
>>>>>>               src.com.javasource
>>>>>>
>>>>>>
>>>>>>
>>>>>>           \ ProjectB (Child)
>>>>>>
>>>>>>               |
>>>>>>
>>>>>>               pom.xml
>>>>>>
>>>>>>               |
>>>>>>
>>>>>>               src.com.javasource
>>>>>>
>>>>>>
>>>>>>
>>>>>>          \ ProjectC
>>>>>>
>>>>>>               |
>>>>>>
>>>>>>               pom.xml
>>>>>>
>>>>>>               |
>>>>>>
>>>>>>               src.com.javasource
>>>>>>
>>>>>>
>>>>>>
>>>>>> So when I will compile or run the command on ProjectA 's  
>>>>>> pom.xml it
>>>>>> should
>>>>>> build the ProjectB and ProjectC and create the projectb.jar and
>>>>>> projectc.jar
>>>>>> and put those jar's into the respective projects target  
>>>>>> directory.
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Jason
>>>>
>>>> ----------------------------------------------------------
>>>> Jason van Zyl
>>>> Founder,  Apache Maven
>>>> http://twitter.com/jvanzyl
>>>> ----------------------------------------------------------
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>
>> Thanks,
>>
>> Jason
>>
>> ----------------------------------------------------------
>> Jason van Zyl
>> Founder,  Apache Maven
>> http://twitter.com/jvanzyl
>> ----------------------------------------------------------
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------


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


Re: Building Multiple Eclipse with Maven

Posted by Roland Asmann <Ro...@cfc.at>.
>
> On 2009-09-27, at 1:40 PM, Roland Asmann wrote:
>
>>>
>>> On 2009-09-27, at 6:59 AM, Nayan Hajratwala wrote:
>>>
>>>> if you're using the m2eclipse plugin, building project b will force
>>>> a build of project a... but all the jar files will be installed into
>>>> and resolved from your local maven repository (~/.m2/repository),
>>>> not the target directory.
>>>>
>>>
>>> The JARs will not be resolved from the local repository by default if
>>> you are using M2Eclipse. They are resolved from the workspace which
>>> is
>>> one of the primary reasons for using M2Eclipse: the live management
>>> of
>>> your dependencies and being able to work with them as you would
>>> expect
>>> in Eclipse. It's when you use the maven-eclipse-plugin that you get
>>> this un-live connection to the local repository which is an extremely
>>> inefficient way to work.
>>
>> I disagree. I've been using the maven-eclipse-plugin ever since we
>> started
>> working with Maven and I have yet to be disappointed by it. A
>> colleague
>> wrote a rather nice tutorial on how to set up your workspace for using
>> Maven and the maven-eclipse-plugin.
>> (http://maven.apache.org/plugins/maven-eclipse-plugin/examples/multi-module-projects.html
>> )
>>
>
> You are free to work however you like. I'll qualify what I said by
> saying that from what I've observed having real workspace resolution
> make developers more efficient then having to use the local repository
> as a mediator. If you want to use the maven-eclipse-plugin and that
> fits your development workflow that's cool. It's just not going to
> work with M2Eclipse because we just have too many support issues an
> there are no developers who work on both sides to create parity.

Again, the way we work DOES have real workspace resolution. The
maven-eclipse-plugin makes the projects in the reactor reference each
other PER DEFAULT, and any other projects in the workspace if you tell it
to.

I'm not trying to tell anybody not to use M2Eclipse or anything, I just
want to state that it is not correct to say that you can't use the plugin
if you want workspace resolution.

>
>> To be honest though, I haven't looked at m2eclipse in quite some time
>> (think years, not months), so it might be better than the
>> maven-eclipse-plugin by now. But as long as thinks work for me, I
>> don' t
>> think I would switch.
>>
>
> You are free to use whatever you like. We just can support
> interoperability indefinitely so with the 1.0 of M2Eclipse mixed use
> of the maven-eclipse-plugin and M2Eclipse will not be supported.
>
>>>
>>> From the M2Eclipse side we are soon just going to raise a huge
>>> warning to people using the maven-eclipse-plugin basically saying we
>>> don't support any interoperability between files generated with the
>>> maven-eclipse-plugin and properly importing projects into Eclipse
>>> using M2Eclipse. It's just causing too many support issues.
>>>
>>> We are also not going to support the N:1 mapping of many Maven
>>> projects to a single Eclipse project because that just destroys the
>>> natural mapping of Maven to Eclipse projects. It also causes
>>> seriously
>>> problems because if you N Maven project where different plugins are
>>> used in different projects we can't accurately run the lifecycle
>>> correctly for each of those projects if you merge them all together.
>>> In this case we have to run everything for all projects, or have to
>>> do
>>> some very unnatural things to preserve this mapping ourselves which
>>> we
>>> decided not to do. We decided to go the path of having one Eclipse
>>> project for every Maven project and we'll correct any problems with
>>> that model.
>>>
>>> Now that we have M2Eclipse synced up with Maven 3.x trunk and 3.x is
>>> compatible with 2.x this is the way forward. At least if you want to
>>> use M2Eclipse. We are now in a position to fix problems in Maven 3.x,
>>> turn around and absorb those changes in M2Eclipse and patch anything
>>> wrong in M2Eclipse
>>>
>>>> Not sure why you would want the jar files in your target
>>>> directory... is there some sort of project specific reason for this?
>>>>
>>>>
>>>> ---
>>>> Nayan Hajratwala
>>>> http://agileshrugged.com
>>>> http://twitter.com/nhajratw
>>>> 734.658.6032
>>>>
>>>> On Sep 25, 2009, at 6:41 PM, Piyush Gupta wrote:
>>>>
>>>>> I have configured Multiple project in my eclipse workspace and each
>>>>> project
>>>>> has its own POM.XML . I have worked with the dependencies with
>>>>> single
>>>>> eclipse project with multiple modules in that single project and it
>>>>> works
>>>>> fine when build with Maven but when working with Different projects
>>>>> is there
>>>>> any possibility to build the all the project with one single parent
>>>>> project?
>>>>> I do not want to build all the dependent project and install the
>>>>> JAR in
>>>>> local repository and than build the parent project I know that will
>>>>> work
>>>>> fine. What I want to achieve is with out building the dependent
>>>>> project I
>>>>> will just build the Parent Project and it will build all the
>>>>> dependent
>>>>> project plus all the Third party JAR's which every project is
>>>>> having and put
>>>>> it into the local repo and every project's respective target
>>>>> directory.
>>>>>
>>>>>
>>>>>
>>>>> The project structure in eclipse is like this
>>>>>
>>>>>
>>>>>
>>>>> C:\eclipse\workspace
>>>>>
>>>>>                \ ProjectA
>>>>>
>>>>>                |
>>>>>
>>>>>                pom.xml
>>>>>
>>>>>                |
>>>>>
>>>>>                src.com.javasource
>>>>>
>>>>>
>>>>>
>>>>>            \ ProjectB (Child)
>>>>>
>>>>>                |
>>>>>
>>>>>                pom.xml
>>>>>
>>>>>                |
>>>>>
>>>>>                src.com.javasource
>>>>>
>>>>>
>>>>>
>>>>>           \ ProjectC
>>>>>
>>>>>                |
>>>>>
>>>>>                pom.xml
>>>>>
>>>>>                |
>>>>>
>>>>>                src.com.javasource
>>>>>
>>>>>
>>>>>
>>>>> So when I will compile or run the command on ProjectA 's pom.xml it
>>>>> should
>>>>> build the ProjectB and ProjectC and create the projectb.jar and
>>>>> projectc.jar
>>>>> and put those jar's into the respective projects target directory.
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>> Thanks,
>>>
>>> Jason
>>>
>>> ----------------------------------------------------------
>>> Jason van Zyl
>>> Founder,  Apache Maven
>>> http://twitter.com/jvanzyl
>>> ----------------------------------------------------------
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> ----------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>



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


Re: Building Multiple Eclipse with Maven

Posted by Jason van Zyl <jv...@sonatype.com>.
On 2009-09-27, at 1:40 PM, Roland Asmann wrote:

>>
>> On 2009-09-27, at 6:59 AM, Nayan Hajratwala wrote:
>>
>>> if you're using the m2eclipse plugin, building project b will force
>>> a build of project a... but all the jar files will be installed into
>>> and resolved from your local maven repository (~/.m2/repository),
>>> not the target directory.
>>>
>>
>> The JARs will not be resolved from the local repository by default if
>> you are using M2Eclipse. They are resolved from the workspace which  
>> is
>> one of the primary reasons for using M2Eclipse: the live management  
>> of
>> your dependencies and being able to work with them as you would  
>> expect
>> in Eclipse. It's when you use the maven-eclipse-plugin that you get
>> this un-live connection to the local repository which is an extremely
>> inefficient way to work.
>
> I disagree. I've been using the maven-eclipse-plugin ever since we  
> started
> working with Maven and I have yet to be disappointed by it. A  
> colleague
> wrote a rather nice tutorial on how to set up your workspace for using
> Maven and the maven-eclipse-plugin.
> (http://maven.apache.org/plugins/maven-eclipse-plugin/examples/multi-module-projects.html 
> )
>

You are free to work however you like. I'll qualify what I said by  
saying that from what I've observed having real workspace resolution  
make developers more efficient then having to use the local repository  
as a mediator. If you want to use the maven-eclipse-plugin and that  
fits your development workflow that's cool. It's just not going to  
work with M2Eclipse because we just have too many support issues an  
there are no developers who work on both sides to create parity.

> To be honest though, I haven't looked at m2eclipse in quite some time
> (think years, not months), so it might be better than the
> maven-eclipse-plugin by now. But as long as thinks work for me, I  
> don' t
> think I would switch.
>

You are free to use whatever you like. We just can support  
interoperability indefinitely so with the 1.0 of M2Eclipse mixed use  
of the maven-eclipse-plugin and M2Eclipse will not be supported.

>>
>> From the M2Eclipse side we are soon just going to raise a huge
>> warning to people using the maven-eclipse-plugin basically saying we
>> don't support any interoperability between files generated with the
>> maven-eclipse-plugin and properly importing projects into Eclipse
>> using M2Eclipse. It's just causing too many support issues.
>>
>> We are also not going to support the N:1 mapping of many Maven
>> projects to a single Eclipse project because that just destroys the
>> natural mapping of Maven to Eclipse projects. It also causes  
>> seriously
>> problems because if you N Maven project where different plugins are
>> used in different projects we can't accurately run the lifecycle
>> correctly for each of those projects if you merge them all together.
>> In this case we have to run everything for all projects, or have to  
>> do
>> some very unnatural things to preserve this mapping ourselves which  
>> we
>> decided not to do. We decided to go the path of having one Eclipse
>> project for every Maven project and we'll correct any problems with
>> that model.
>>
>> Now that we have M2Eclipse synced up with Maven 3.x trunk and 3.x is
>> compatible with 2.x this is the way forward. At least if you want to
>> use M2Eclipse. We are now in a position to fix problems in Maven 3.x,
>> turn around and absorb those changes in M2Eclipse and patch anything
>> wrong in M2Eclipse
>>
>>> Not sure why you would want the jar files in your target
>>> directory... is there some sort of project specific reason for this?
>>>
>>>
>>> ---
>>> Nayan Hajratwala
>>> http://agileshrugged.com
>>> http://twitter.com/nhajratw
>>> 734.658.6032
>>>
>>> On Sep 25, 2009, at 6:41 PM, Piyush Gupta wrote:
>>>
>>>> I have configured Multiple project in my eclipse workspace and each
>>>> project
>>>> has its own POM.XML . I have worked with the dependencies with  
>>>> single
>>>> eclipse project with multiple modules in that single project and it
>>>> works
>>>> fine when build with Maven but when working with Different projects
>>>> is there
>>>> any possibility to build the all the project with one single parent
>>>> project?
>>>> I do not want to build all the dependent project and install the
>>>> JAR in
>>>> local repository and than build the parent project I know that will
>>>> work
>>>> fine. What I want to achieve is with out building the dependent
>>>> project I
>>>> will just build the Parent Project and it will build all the
>>>> dependent
>>>> project plus all the Third party JAR's which every project is
>>>> having and put
>>>> it into the local repo and every project's respective target
>>>> directory.
>>>>
>>>>
>>>>
>>>> The project structure in eclipse is like this
>>>>
>>>>
>>>>
>>>> C:\eclipse\workspace
>>>>
>>>>                \ ProjectA
>>>>
>>>>                |
>>>>
>>>>                pom.xml
>>>>
>>>>                |
>>>>
>>>>                src.com.javasource
>>>>
>>>>
>>>>
>>>>            \ ProjectB (Child)
>>>>
>>>>                |
>>>>
>>>>                pom.xml
>>>>
>>>>                |
>>>>
>>>>                src.com.javasource
>>>>
>>>>
>>>>
>>>>           \ ProjectC
>>>>
>>>>                |
>>>>
>>>>                pom.xml
>>>>
>>>>                |
>>>>
>>>>                src.com.javasource
>>>>
>>>>
>>>>
>>>> So when I will compile or run the command on ProjectA 's pom.xml it
>>>> should
>>>> build the ProjectB and ProjectC and create the projectb.jar and
>>>> projectc.jar
>>>> and put those jar's into the respective projects target directory.
>>>>
>>>>
>>>>
>>>
>>
>> Thanks,
>>
>> Jason
>>
>> ----------------------------------------------------------
>> Jason van Zyl
>> Founder,  Apache Maven
>> http://twitter.com/jvanzyl
>> ----------------------------------------------------------
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------


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


Re: Building Multiple Eclipse with Maven

Posted by Roland Asmann <Ro...@cfc.at>.
>
> On 2009-09-27, at 6:59 AM, Nayan Hajratwala wrote:
>
>> if you're using the m2eclipse plugin, building project b will force
>> a build of project a... but all the jar files will be installed into
>> and resolved from your local maven repository (~/.m2/repository),
>> not the target directory.
>>
>
> The JARs will not be resolved from the local repository by default if
> you are using M2Eclipse. They are resolved from the workspace which is
> one of the primary reasons for using M2Eclipse: the live management of
> your dependencies and being able to work with them as you would expect
> in Eclipse. It's when you use the maven-eclipse-plugin that you get
> this un-live connection to the local repository which is an extremely
> inefficient way to work.

I disagree. I've been using the maven-eclipse-plugin ever since we started
working with Maven and I have yet to be disappointed by it. A colleague
wrote a rather nice tutorial on how to set up your workspace for using
Maven and the maven-eclipse-plugin.
(http://maven.apache.org/plugins/maven-eclipse-plugin/examples/multi-module-projects.html)

To be honest though, I haven't looked at m2eclipse in quite some time
(think years, not months), so it might be better than the
maven-eclipse-plugin by now. But as long as thinks work for me, I don' t
think I would switch.

>
>  From the M2Eclipse side we are soon just going to raise a huge
> warning to people using the maven-eclipse-plugin basically saying we
> don't support any interoperability between files generated with the
> maven-eclipse-plugin and properly importing projects into Eclipse
> using M2Eclipse. It's just causing too many support issues.
>
> We are also not going to support the N:1 mapping of many Maven
> projects to a single Eclipse project because that just destroys the
> natural mapping of Maven to Eclipse projects. It also causes seriously
> problems because if you N Maven project where different plugins are
> used in different projects we can't accurately run the lifecycle
> correctly for each of those projects if you merge them all together.
> In this case we have to run everything for all projects, or have to do
> some very unnatural things to preserve this mapping ourselves which we
> decided not to do. We decided to go the path of having one Eclipse
> project for every Maven project and we'll correct any problems with
> that model.
>
> Now that we have M2Eclipse synced up with Maven 3.x trunk and 3.x is
> compatible with 2.x this is the way forward. At least if you want to
> use M2Eclipse. We are now in a position to fix problems in Maven 3.x,
> turn around and absorb those changes in M2Eclipse and patch anything
> wrong in M2Eclipse
>
>> Not sure why you would want the jar files in your target
>> directory... is there some sort of project specific reason for this?
>>
>>
>> ---
>> Nayan Hajratwala
>> http://agileshrugged.com
>> http://twitter.com/nhajratw
>> 734.658.6032
>>
>> On Sep 25, 2009, at 6:41 PM, Piyush Gupta wrote:
>>
>>> I have configured Multiple project in my eclipse workspace and each
>>> project
>>> has its own POM.XML . I have worked with the dependencies with single
>>> eclipse project with multiple modules in that single project and it
>>> works
>>> fine when build with Maven but when working with Different projects
>>> is there
>>> any possibility to build the all the project with one single parent
>>> project?
>>> I do not want to build all the dependent project and install the
>>> JAR in
>>> local repository and than build the parent project I know that will
>>> work
>>> fine. What I want to achieve is with out building the dependent
>>> project I
>>> will just build the Parent Project and it will build all the
>>> dependent
>>> project plus all the Third party JAR's which every project is
>>> having and put
>>> it into the local repo and every project's respective target
>>> directory.
>>>
>>>
>>>
>>> The project structure in eclipse is like this
>>>
>>>
>>>
>>> C:\eclipse\workspace
>>>
>>>                 \ ProjectA
>>>
>>>                 |
>>>
>>>                 pom.xml
>>>
>>>                 |
>>>
>>>                 src.com.javasource
>>>
>>>
>>>
>>>             \ ProjectB (Child)
>>>
>>>                 |
>>>
>>>                 pom.xml
>>>
>>>                 |
>>>
>>>                 src.com.javasource
>>>
>>>
>>>
>>>            \ ProjectC
>>>
>>>                 |
>>>
>>>                 pom.xml
>>>
>>>                 |
>>>
>>>                 src.com.javasource
>>>
>>>
>>>
>>> So when I will compile or run the command on ProjectA 's pom.xml it
>>> should
>>> build the ProjectB and ProjectC and create the projectb.jar and
>>> projectc.jar
>>> and put those jar's into the respective projects target directory.
>>>
>>>
>>>
>>
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> ----------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>



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


Re: Building Multiple Eclipse with Maven

Posted by Jason van Zyl <jv...@sonatype.com>.
On 2009-09-27, at 8:30 AM, Nayan Hajratwala wrote:

> On Sep 27, 2009, at 11:26 AM, Jason van Zyl wrote:
>
>>
>> On 2009-09-27, at 6:59 AM, Nayan Hajratwala wrote:
>>
>>> if you're using the m2eclipse plugin, building project b will  
>>> force a build of project a... but all the jar files will be  
>>> installed into and resolved from your local maven repository  
>>> (~/.m2/repository), not the target directory.
>>>
>>
>> The JARs will not be resolved from the local repository by default  
>> if you are using M2Eclipse. They are resolved from the workspace  
>> which is one of the primary reasons for using M2Eclipse: the live  
>> management of your dependencies and being able to work with them as  
>> you would expect in Eclipse.
>
> Doh -- thanks for catching my error. I (believe it or not) actually  
> knew this. Perhaps I hadn't had enough coffee yet when writing my  
> response :-)
>
> btw, thanks for all the great usability/stability improvements in  
> m2eclipse over the past couple years!
>

They have all honestly been in the last 6 months where all the  
improvements have been made. You can specifically thank Igor and  
Benjamin. Igor on the M2Eclipse side as he's really made M2Eclipse  
production quality, and Benjamin has done the same on the Maven side.  
They work together constantly to try and improve the user experience  
from Maven workflow into Eclipse.

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

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------


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


Re: Building Multiple Eclipse with Maven

Posted by Nayan Hajratwala <na...@chikli.com>.
On Sep 27, 2009, at 11:26 AM, Jason van Zyl wrote:

>
> On 2009-09-27, at 6:59 AM, Nayan Hajratwala wrote:
>
>> if you're using the m2eclipse plugin, building project b will force  
>> a build of project a... but all the jar files will be installed  
>> into and resolved from your local maven repository (~/.m2/ 
>> repository), not the target directory.
>>
>
> The JARs will not be resolved from the local repository by default  
> if you are using M2Eclipse. They are resolved from the workspace  
> which is one of the primary reasons for using M2Eclipse: the live  
> management of your dependencies and being able to work with them as  
> you would expect in Eclipse.

Doh -- thanks for catching my error. I (believe it or not) actually  
knew this. Perhaps I hadn't had enough coffee yet when writing my  
response :-)

btw, thanks for all the great usability/stability improvements in  
m2eclipse over the past couple years!

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


Re: Building Multiple Eclipse with Maven

Posted by Jason van Zyl <jv...@sonatype.com>.
On 2009-09-27, at 6:59 AM, Nayan Hajratwala wrote:

> if you're using the m2eclipse plugin, building project b will force  
> a build of project a... but all the jar files will be installed into  
> and resolved from your local maven repository (~/.m2/repository),  
> not the target directory.
>

The JARs will not be resolved from the local repository by default if  
you are using M2Eclipse. They are resolved from the workspace which is  
one of the primary reasons for using M2Eclipse: the live management of  
your dependencies and being able to work with them as you would expect  
in Eclipse. It's when you use the maven-eclipse-plugin that you get  
this un-live connection to the local repository which is an extremely  
inefficient way to work.

 From the M2Eclipse side we are soon just going to raise a huge  
warning to people using the maven-eclipse-plugin basically saying we  
don't support any interoperability between files generated with the  
maven-eclipse-plugin and properly importing projects into Eclipse  
using M2Eclipse. It's just causing too many support issues.

We are also not going to support the N:1 mapping of many Maven  
projects to a single Eclipse project because that just destroys the  
natural mapping of Maven to Eclipse projects. It also causes seriously  
problems because if you N Maven project where different plugins are  
used in different projects we can't accurately run the lifecycle  
correctly for each of those projects if you merge them all together.  
In this case we have to run everything for all projects, or have to do  
some very unnatural things to preserve this mapping ourselves which we  
decided not to do. We decided to go the path of having one Eclipse  
project for every Maven project and we'll correct any problems with  
that model.

Now that we have M2Eclipse synced up with Maven 3.x trunk and 3.x is  
compatible with 2.x this is the way forward. At least if you want to  
use M2Eclipse. We are now in a position to fix problems in Maven 3.x,  
turn around and absorb those changes in M2Eclipse and patch anything  
wrong in M2Eclipse

> Not sure why you would want the jar files in your target  
> directory... is there some sort of project specific reason for this?
>
>
> ---
> Nayan Hajratwala
> http://agileshrugged.com
> http://twitter.com/nhajratw
> 734.658.6032
>
> On Sep 25, 2009, at 6:41 PM, Piyush Gupta wrote:
>
>> I have configured Multiple project in my eclipse workspace and each  
>> project
>> has its own POM.XML . I have worked with the dependencies with single
>> eclipse project with multiple modules in that single project and it  
>> works
>> fine when build with Maven but when working with Different projects  
>> is there
>> any possibility to build the all the project with one single parent  
>> project?
>> I do not want to build all the dependent project and install the  
>> JAR in
>> local repository and than build the parent project I know that will  
>> work
>> fine. What I want to achieve is with out building the dependent  
>> project I
>> will just build the Parent Project and it will build all the  
>> dependent
>> project plus all the Third party JAR's which every project is  
>> having and put
>> it into the local repo and every project's respective target  
>> directory.
>>
>>
>>
>> The project structure in eclipse is like this
>>
>>
>>
>> C:\eclipse\workspace
>>
>>                 \ ProjectA
>>
>>                 |
>>
>>                 pom.xml
>>
>>                 |
>>
>>                 src.com.javasource
>>
>>
>>
>>             \ ProjectB (Child)
>>
>>                 |
>>
>>                 pom.xml
>>
>>                 |
>>
>>                 src.com.javasource
>>
>>
>>
>>            \ ProjectC
>>
>>                 |
>>
>>                 pom.xml
>>
>>                 |
>>
>>                 src.com.javasource
>>
>>
>>
>> So when I will compile or run the command on ProjectA 's pom.xml it  
>> should
>> build the ProjectB and ProjectC and create the projectb.jar and  
>> projectc.jar
>> and put those jar's into the respective projects target directory.
>>
>>
>>
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
----------------------------------------------------------


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


Re: Building Multiple Eclipse with Maven

Posted by Nayan Hajratwala <na...@chikli.com>.
if you're using the m2eclipse plugin, building project b will force a  
build of project a... but all the jar files will be installed into and  
resolved from your local maven repository (~/.m2/repository), not the  
target directory.

Not sure why you would want the jar files in your target directory...  
is there some sort of project specific reason for this?


---
Nayan Hajratwala
http://agileshrugged.com
http://twitter.com/nhajratw
734.658.6032

On Sep 25, 2009, at 6:41 PM, Piyush Gupta wrote:

> I have configured Multiple project in my eclipse workspace and each  
> project
> has its own POM.XML . I have worked with the dependencies with single
> eclipse project with multiple modules in that single project and it  
> works
> fine when build with Maven but when working with Different projects  
> is there
> any possibility to build the all the project with one single parent  
> project?
> I do not want to build all the dependent project and install the JAR  
> in
> local repository and than build the parent project I know that will  
> work
> fine. What I want to achieve is with out building the dependent  
> project I
> will just build the Parent Project and it will build all the dependent
> project plus all the Third party JAR's which every project is having  
> and put
> it into the local repo and every project's respective target  
> directory.
>
>
>
> The project structure in eclipse is like this
>
>
>
> C:\eclipse\workspace
>
>                  \ ProjectA
>
>                  |
>
>                  pom.xml
>
>                  |
>
>                  src.com.javasource
>
>
>
>              \ ProjectB (Child)
>
>                  |
>
>                  pom.xml
>
>                  |
>
>                  src.com.javasource
>
>
>
>             \ ProjectC
>
>                  |
>
>                  pom.xml
>
>                  |
>
>                  src.com.javasource
>
>
>
> So when I will compile or run the command on ProjectA 's pom.xml it  
> should
> build the ProjectB and ProjectC and create the projectb.jar and  
> projectc.jar
> and put those jar's into the respective projects target directory.
>
>
>