You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jp4 <jo...@hnpsolutions.com> on 2007/02/03 04:15:23 UTC

POM Inheritance

I was wondering if there is any way to achieve multiple pom inheritance with
maven.  I have created several pom abstractions (i.e. data access which
includes dependencies for  hibernate, spring, etc...  webapp which includes
dependencies for struts, etc) for convenience as most of my data access
projects follow the same pattern using hibernate and spring.  I don't want
to have to redefine these dependencies in each of my data access projects. 

Now here is where the problem comes in, I have a multi-module projectA that
has a model, data access, webapp projects.  In addition, I have a
multi-module projectB that has a model, data access, webapp project.  I
would like to have all modules in projectA have the same version so that I
can refer to version for projectA as ${project.version} in my model, data
access, and webapp.  The problem that I have is that I want projectA's data
access project to inherit from both the data access pom as well as the
projectA pom.  Is there any way to do this?  Or is there a different
approach to achieve the desired results?

Thanks,
jp4
-- 
View this message in context: http://www.nabble.com/POM-Inheritance-tf3164691s177.html#a8779117
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: Properties for pom.xml

Posted by franz see <fr...@gmail.com>.
Good day to you, Rahamim,

Although I haven't tried it, I am guessing yes with the help of Maven Remote
Resources plugin.

To make your properties file available in the remote repository, pack that
properties file into a binary and deploy it in your remote repository.

And to be able to use that properties file for filtering, retrieve it in
your other maven projects by using the maven remote resources plugin ( see
[1] on how to use it ), and set the location of the filter files ( see [2]
).

Cheers,
Franz

[1] http://maven.apache.org/plugins/maven-remote-resources-plugin/usage.html
[2]
http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html


Rahamim, Zvi (Zvi) wrote:
> 
> Thank for your answer,
> I want to clarify my motivation:
> I want that all my pom.xml files (and there are many) have the
> properties and values in a property file that resides on my repository.
> I only need to load them into the pom.xml so that it could see them,
> Is there a way to do so?
> Thanks again!
> Zvi. 
> 
> -----Original Message-----
> From: franz see [mailto:franz.see@gmail.com] 
> Sent: Sunday, February 04, 2007 5:35 PM
> To: users@maven.apache.org
> Subject: Re: Properties for pom.xml
> 
> 
> Good day,
> 
> Pardon, my answer was incomplete :-)
> 
> You may want to use [1] to get the resource, and use [2] to declare that
> file as a filter file ( a file containing properties ).
> 
> Cheers,
> Franz
> 
> [1] http://maven.apache.org/plugins/maven-remote-resources-plugin/
> [2]
> http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.h
> tml
> 
> 
> franz see wrote:
>> 
>> Good day to you, Rahamin,
>> 
>> You may want to take a look at [1].
>> 
>> Cheers,
>> Franz
>> 
>> [1] http://maven.apache.org/plugins/maven-remote-resources-plugin/
>> 
>> 
>> Rahamim, Zvi (Zvi) wrote:
>>> 
>>> Hi,
>>> Is there a way to tell my pom.xml to load properties from a property 
>>> file that resides in a remote repository?
>>> Example for such property file is com/myapp/myprop/A.properties.
>>> Thanks!
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> --
> View this message in context:
> http://www.nabble.com/POM-Inheritance-tf3164691s177.html#a8793783
> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/POM-Inheritance-tf3164691s177.html#a8819647
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: Properties for pom.xml

Posted by "Rahamim, Zvi (Zvi)" <zr...@avaya.com>.
Thank for your answer,
I want to clarify my motivation:
I want that all my pom.xml files (and there are many) have the
properties and values in a property file that resides on my repository.
I only need to load them into the pom.xml so that it could see them,
Is there a way to do so?
Thanks again!
Zvi. 

-----Original Message-----
From: franz see [mailto:franz.see@gmail.com] 
Sent: Sunday, February 04, 2007 5:35 PM
To: users@maven.apache.org
Subject: Re: Properties for pom.xml


Good day,

Pardon, my answer was incomplete :-)

You may want to use [1] to get the resource, and use [2] to declare that
file as a filter file ( a file containing properties ).

Cheers,
Franz

[1] http://maven.apache.org/plugins/maven-remote-resources-plugin/
[2]
http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.h
tml


franz see wrote:
> 
> Good day to you, Rahamin,
> 
> You may want to take a look at [1].
> 
> Cheers,
> Franz
> 
> [1] http://maven.apache.org/plugins/maven-remote-resources-plugin/
> 
> 
> Rahamim, Zvi (Zvi) wrote:
>> 
>> Hi,
>> Is there a way to tell my pom.xml to load properties from a property 
>> file that resides in a remote repository?
>> Example for such property file is com/myapp/myprop/A.properties.
>> Thanks!
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
>> 
> 
> 

--
View this message in context:
http://www.nabble.com/POM-Inheritance-tf3164691s177.html#a8793783
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


Re: Properties for pom.xml

Posted by franz see <fr...@gmail.com>.
Good day,

Pardon, my answer was incomplete :-)

You may want to use [1] to get the resource, and use [2] to declare that
file as a filter file ( a file containing properties ).

Cheers,
Franz

[1] http://maven.apache.org/plugins/maven-remote-resources-plugin/
[2]
http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html


franz see wrote:
> 
> Good day to you, Rahamin,
> 
> You may want to take a look at [1].
> 
> Cheers,
> Franz
> 
> [1] http://maven.apache.org/plugins/maven-remote-resources-plugin/
> 
> 
> Rahamim, Zvi (Zvi) wrote:
>> 
>> Hi,
>> Is there a way to tell my pom.xml to load properties from a property
>> file that resides in a remote repository?
>> Example for such property file is com/myapp/myprop/A.properties.
>> Thanks!
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/POM-Inheritance-tf3164691s177.html#a8793783
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: Properties for pom.xml

Posted by franz see <fr...@gmail.com>.
Good day to you, Rahamin,

You may want to take a look at [1].

Cheers,
Franz

[1] http://maven.apache.org/plugins/maven-remote-resources-plugin/


Rahamim, Zvi (Zvi) wrote:
> 
> Hi,
> Is there a way to tell my pom.xml to load properties from a property
> file that resides in a remote repository?
> Example for such property file is com/myapp/myprop/A.properties.
> Thanks!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/POM-Inheritance-tf3164691s177.html#a8793768
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


Properties for pom.xml

Posted by "Rahamim, Zvi (Zvi)" <zr...@avaya.com>.
Hi,
Is there a way to tell my pom.xml to load properties from a property
file that resides in a remote repository?
Example for such property file is com/myapp/myprop/A.properties.
Thanks!

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


Re: POM Inheritance

Posted by franz see <fr...@gmail.com>.
Good day to you, jp4,

Maven2 does not have multiple pom inheritance. 

You may want to try and use profile.xml and build.xml. I am not sure if they
can be used as workarounds to "2nd" and "3rd parents" though, but that's the
only thing I can think of right now.

Cheers,
Franz


jp4 wrote:
> 
> I was wondering if there is any way to achieve multiple pom inheritance
> with maven.  I have created several pom abstractions (i.e. data access
> which includes dependencies for  hibernate, spring, etc...  webapp which
> includes dependencies for struts, etc) for convenience as most of my data
> access projects follow the same pattern using hibernate and spring.  I
> don't want to have to redefine these dependencies in each of my data
> access projects. 
> 
> Now here is where the problem comes in, I have a multi-module projectA
> that has a model, data access, webapp projects.  In addition, I have a
> multi-module projectB that has a model, data access, webapp project.  I
> would like to have all modules in projectA have the same version so that I
> can refer to version for projectA as ${project.version} in my model, data
> access, and webapp.  The problem that I have is that I want projectA's
> data access project to inherit from both the data access pom as well as
> the projectA pom.  Is there any way to do this?  Or is there a different
> approach to achieve the desired results?
> 
> Thanks,
> jp4
> 

-- 
View this message in context: http://www.nabble.com/POM-Inheritance-tf3164691s177.html#a8781510
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: [m2] POM Inheritance

Posted by jp4 <jo...@hnpsolutions.com>.
I still haven't found a good solution for this and I was hoping to spark some
discussion with a follow up post.


jp4 wrote:
> 
> I was wondering if there is any way to achieve multiple pom inheritance
> with maven.  I have created several pom abstractions (i.e. data access
> which includes dependencies for  hibernate, spring, etc...  webapp which
> includes dependencies for struts, etc) for convenience as most of my data
> access projects follow the same pattern using hibernate and spring.  I
> don't want to have to redefine these dependencies in each of my data
> access projects. 
> 
> Now here is where the problem comes in, I have a multi-module projectA
> that has a model, data access, webapp projects.  In addition, I have a
> multi-module projectB that has a model, data access, webapp project.  I
> would like to have all modules in projectA have the same version so that I
> can refer to version for projectA as ${project.version} in my model, data
> access, and webapp.  The problem that I have is that I want projectA's
> data access project to inherit from both the data access pom as well as
> the projectA pom.  Is there any way to do this?  Or is there a different
> approach to achieve the desired results?
> 
> Thanks,
> jp4
> 

-- 
View this message in context: http://www.nabble.com/POM-Inheritance-tf3164691s177.html#a9107889
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