You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by user09772 <so...@gmail.com> on 2010/03/02 19:24:15 UTC

Newbie Maven layout question

I've used maven in very simple projects.

Currently I'm in the process of developing a somewhat larger application.
I'd like some ideas from experienced users on how i can layout the following
situation.  I have split a project into various high level maven projects.  

some projects are rest service 
some projects are chains (commons)
some projects are commands for use in the chains

There are other pieces which are not as important.  The rest services
projects acts like the parent which will include a mix of other projects as
necessary.  I'm curious how one would layout a project like this?  Any
tutorials will be helpful on this type of setup (preferably using m2eclipse)
.  Thanks.
-- 
View this message in context: http://old.nabble.com/Newbie-Maven-layout-question-tp27759332p27759332.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: Newbie Maven layout question

Posted by Ron Wheeler <rw...@artifact-software.com>.
user09772 wrote:
> How can a module be independent?  meaning standalone within eclipse.  because
> as it is now, the parent pom is responsible to glue everything together at
> build time (not the webapp module for example within eclipse).
>   
The Eclipse project Module 4 will have a POM that creates a jar file 
with a groupid, an artifactId and a version.
If you are smart you will have a Nexus repository where the POM will 
deploy module4.jar

The Eclipse project Module2 will have a POM that has a dependency on the 
module4 jar identifying it with the correct groupid, the artifactId and 
the version. it will  deploy the module2.jar in the repository

The Eclipse project Module 3 will have a POM that creates a jar file 
with a groupid, an artifactId and a version.
  and deploy the module3.jar in the repository

The Eclipse project Module1 will have a POM that has a dependency on the 
module1, module 2 and module3 jars identifying each with the correct 
groupid, the artifactId and the version. It will create a WAR file (if 
that is what you want).
It does not need to reference module 4 since module2's dependency on 
module 4 is known through the pom file in module2.

Your life just got a lot simpler.

Ron
>
>
> user09772 wrote:
>   
>> Thanks that is an excellent resource.
>>
>> I think parent poms is what i was looking for.
>>
>> The way i understand it parent poms are used to simply install the proper
>> modules?  so for each product its possible to have a parent pom which ties
>> various modules into the repro.  
>>
>> If module1 depends on module2 & module3, but module4 only needs to be
>> visible to module2.  How can i do this hierarchy with parent poms?  Will
>> the parent pom have all the modules, and module4 have module2 as it's
>> dependency?
>>
>>
>> Patrick Turcotte-3 wrote:
>>     
>>> Part of your problem could/(should?) be resolved with parent poms.
>>>
>>> A good read is the sonatype maven book (
>>> http://www.sonatype.com/products/maven/documentation/book-defguide)
>>>
>>> Patrick
>>>
>>> On 10-03-02 02:18 PM, user09772 wrote:
>>>       
>>>> dahoffer wrote:
>>>>   
>>>>         
>>>>> Without knowing details all I can give are general suggestions...
>>>>>
>>>>> - Things you want to version/branch as a unit go in the same project
>>>>> (may have several modules).
>>>>> - Common things that are used in more than one project go in a
>>>>> separate project (may have several modules) and are depended on as
>>>>> needed.
>>>>>
>>>>> -Dave
>>>>>
>>>>>
>>>>>
>>>>>     
>>>>>           
>>>> Thanks for the response. 
>>>>
>>>> Right.  so all the projects i mentioned would need to be versioning (the
>>>> commands will change that the services use, the services will change
>>>> that
>>>> the rest projects use etc.).  That is at a high level point of view
>>>> right. 
>>>> I'm probably thinking more on how to use Maven modules to provide
>>>> separation
>>>> between each of the components.
>>>>
>>>> The main thing i would like to accomplish is have the ability to switch
>>>> out
>>>> any of the projects (modules?) with another one and build the system
>>>> using
>>>> those new modules.
>>>>   
>>>>         
>>>       
>>     
>
>   


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


Re: Newbie Maven layout question

Posted by user09772 <so...@gmail.com>.
How can a module be independent?  meaning standalone within eclipse.  because
as it is now, the parent pom is responsible to glue everything together at
build time (not the webapp module for example within eclipse).



user09772 wrote:
> 
> Thanks that is an excellent resource.
> 
> I think parent poms is what i was looking for.
> 
> The way i understand it parent poms are used to simply install the proper
> modules?  so for each product its possible to have a parent pom which ties
> various modules into the repro.  
> 
> If module1 depends on module2 & module3, but module4 only needs to be
> visible to module2.  How can i do this hierarchy with parent poms?  Will
> the parent pom have all the modules, and module4 have module2 as it's
> dependency?
> 
> 
> Patrick Turcotte-3 wrote:
>> 
>> 
>> Part of your problem could/(should?) be resolved with parent poms.
>> 
>> A good read is the sonatype maven book (
>> http://www.sonatype.com/products/maven/documentation/book-defguide)
>> 
>> Patrick
>> 
>> On 10-03-02 02:18 PM, user09772 wrote:
>>>
>>>
>>> dahoffer wrote:
>>>   
>>>> Without knowing details all I can give are general suggestions...
>>>>
>>>> - Things you want to version/branch as a unit go in the same project
>>>> (may have several modules).
>>>> - Common things that are used in more than one project go in a
>>>> separate project (may have several modules) and are depended on as
>>>> needed.
>>>>
>>>> -Dave
>>>>
>>>>
>>>>
>>>>     
>>> Thanks for the response. 
>>>
>>> Right.  so all the projects i mentioned would need to be versioning (the
>>> commands will change that the services use, the services will change
>>> that
>>> the rest projects use etc.).  That is at a high level point of view
>>> right. 
>>> I'm probably thinking more on how to use Maven modules to provide
>>> separation
>>> between each of the components.
>>>
>>> The main thing i would like to accomplish is have the ability to switch
>>> out
>>> any of the projects (modules?) with another one and build the system
>>> using
>>> those new modules.
>>>   
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Newbie-Maven-layout-question-tp27759332p27772511.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: Newbie Maven layout question

Posted by user09772 <so...@gmail.com>.
Thanks that is an excellent resource.

I think parent poms is what i was looking for.

The way i understand it parent poms are used to simply install the proper
modules?  so for each product its possible to have a parent pom which ties
various modules into the repro.  

If module1 depends on module2 & module3, but module4 only needs to be
visible to module2.  How can i do this hierarchy with parent poms?  Will the
parent pom have all the modules, and module4 have module2 as it's
dependency?


Patrick Turcotte-3 wrote:
> 
> 
> Part of your problem could/(should?) be resolved with parent poms.
> 
> A good read is the sonatype maven book (
> http://www.sonatype.com/products/maven/documentation/book-defguide)
> 
> Patrick
> 
> On 10-03-02 02:18 PM, user09772 wrote:
>>
>>
>> dahoffer wrote:
>>   
>>> Without knowing details all I can give are general suggestions...
>>>
>>> - Things you want to version/branch as a unit go in the same project
>>> (may have several modules).
>>> - Common things that are used in more than one project go in a
>>> separate project (may have several modules) and are depended on as
>>> needed.
>>>
>>> -Dave
>>>
>>>
>>>
>>>     
>> Thanks for the response. 
>>
>> Right.  so all the projects i mentioned would need to be versioning (the
>> commands will change that the services use, the services will change that
>> the rest projects use etc.).  That is at a high level point of view
>> right. 
>> I'm probably thinking more on how to use Maven modules to provide
>> separation
>> between each of the components.
>>
>> The main thing i would like to accomplish is have the ability to switch
>> out
>> any of the projects (modules?) with another one and build the system
>> using
>> those new modules.
>>   
> 
> 

-- 
View this message in context: http://old.nabble.com/Newbie-Maven-layout-question-tp27759332p27771944.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: Newbie Maven layout question

Posted by Patrick Turcotte <pa...@revolutionlinux.com>.
Part of your problem could/(should?) be resolved with parent poms.

A good read is the sonatype maven book (
http://www.sonatype.com/products/maven/documentation/book-defguide)

Patrick

On 10-03-02 02:18 PM, user09772 wrote:
>
>
> dahoffer wrote:
>   
>> Without knowing details all I can give are general suggestions...
>>
>> - Things you want to version/branch as a unit go in the same project
>> (may have several modules).
>> - Common things that are used in more than one project go in a
>> separate project (may have several modules) and are depended on as
>> needed.
>>
>> -Dave
>>
>>
>>
>>     
> Thanks for the response. 
>
> Right.  so all the projects i mentioned would need to be versioning (the
> commands will change that the services use, the services will change that
> the rest projects use etc.).  That is at a high level point of view right. 
> I'm probably thinking more on how to use Maven modules to provide separation
> between each of the components.
>
> The main thing i would like to accomplish is have the ability to switch out
> any of the projects (modules?) with another one and build the system using
> those new modules.
>   

Re: Newbie Maven layout question

Posted by user09772 <so...@gmail.com>.


dahoffer wrote:
> 
> Without knowing details all I can give are general suggestions...
> 
> - Things you want to version/branch as a unit go in the same project
> (may have several modules).
> - Common things that are used in more than one project go in a
> separate project (may have several modules) and are depended on as
> needed.
> 
> -Dave
> 
> 
> 
Thanks for the response. 

Right.  so all the projects i mentioned would need to be versioning (the
commands will change that the services use, the services will change that
the rest projects use etc.).  That is at a high level point of view right. 
I'm probably thinking more on how to use Maven modules to provide separation
between each of the components.

The main thing i would like to accomplish is have the ability to switch out
any of the projects (modules?) with another one and build the system using
those new modules.
-- 
View this message in context: http://old.nabble.com/Newbie-Maven-layout-question-tp27759332p27759991.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: Newbie Maven layout question

Posted by David Hoffer <dh...@gmail.com>.
Without knowing details all I can give are general suggestions...

- Things you want to version/branch as a unit go in the same project
(may have several modules).
- Common things that are used in more than one project go in a
separate project (may have several modules) and are depended on as
needed.

-Dave


On Tue, Mar 2, 2010 at 11:24 AM, user09772 <so...@gmail.com> wrote:
>
> I've used maven in very simple projects.
>
> Currently I'm in the process of developing a somewhat larger application.
> I'd like some ideas from experienced users on how i can layout the following
> situation.  I have split a project into various high level maven projects.
>
> some projects are rest service
> some projects are chains (commons)
> some projects are commands for use in the chains
>
> There are other pieces which are not as important.  The rest services
> projects acts like the parent which will include a mix of other projects as
> necessary.  I'm curious how one would layout a project like this?  Any
> tutorials will be helpful on this type of setup (preferably using m2eclipse)
> .  Thanks.
> --
> View this message in context: http://old.nabble.com/Newbie-Maven-layout-question-tp27759332p27759332.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
>
>

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