You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Max Spring <m2...@springdot.org> on 2016/03/10 21:20:56 UTC
"conditional" parent POM?
What's the best structure for a (multi-module) Maven project which should build "in the wild" without any Maven repository manager and can easily build within my organization where deployments should happen to my Maven repository manager?
Ideally, I would have two different paren POMs for each situation. But unfortunately, I can't use a Maven property to pass the correct value for each situation, because the property expression in the parent POM reference doesn't get interpolated, if I try something like
<parent>
<groupId>org.example</groupId>
<artifactId>${root.pom}</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath/>
</parent>
...
<properties>
<root.pom>wild-parent</root.pom>
</properties>
Added a minimalistic project which shows a crude approach to solve this by patching the parent POM via sed:
https://github.com/m2spring/wild-inhouse-hybrid-example
-Max
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: "conditional" parent POM?
Posted by Max Spring <m2...@springdot.org>.
Hi Manfred,
you're right, "property-injection" is what I want.
I updated my example: https://github.com/m2spring/wild-inhouse-hybrid-example/tree/property-approach
Thank you!
Regards,
-Max
On 03/10/2016 12:40 PM, Manfred Moser wrote:
> You should not use different rool poms. The whole upstream parents for your open source project should be open source as well.
>
> And if you want to deploy to a different repo manager you can make the URLs configurable as a property that you set in the pom and e.g. override in your internal setup via settings.xml.
>
> Manfred
>
> Max Spring wrote on 2016-03-10 12:20:
>
>> What's the best structure for a (multi-module) Maven project which should build
>> "in the wild" without any Maven repository manager and can easily build within
>> my organization where deployments should happen to my Maven repository manager?
>>
>> Ideally, I would have two different paren POMs for each situation. But
>> unfortunately, I can't use a Maven property to pass the correct value for each
>> situation, because the property expression in the parent POM reference doesn't
>> get interpolated, if I try something like
>>
>> <parent>
>> <groupId>org.example</groupId>
>> <artifactId>${root.pom}</artifactId>
>> <version>1.0-SNAPSHOT</version>
>> <relativePath/>
>> </parent>
>> ...
>> <properties>
>> <root.pom>wild-parent</root.pom>
>> </properties>
>>
>> Added a minimalistic project which shows a crude approach to solve this by
>> patching the parent POM via sed:
>> https://github.com/m2spring/wild-inhouse-hybrid-example
>>
>> -Max
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: "conditional" parent POM?
Posted by Manfred Moser <ma...@simpligility.com>.
You should not use different rool poms. The whole upstream parents for your open source project should be open source as well.
And if you want to deploy to a different repo manager you can make the URLs configurable as a property that you set in the pom and e.g. override in your internal setup via settings.xml.
Manfred
Max Spring wrote on 2016-03-10 12:20:
> What's the best structure for a (multi-module) Maven project which should build
> "in the wild" without any Maven repository manager and can easily build within
> my organization where deployments should happen to my Maven repository manager?
>
> Ideally, I would have two different paren POMs for each situation. But
> unfortunately, I can't use a Maven property to pass the correct value for each
> situation, because the property expression in the parent POM reference doesn't
> get interpolated, if I try something like
>
> <parent>
> <groupId>org.example</groupId>
> <artifactId>${root.pom}</artifactId>
> <version>1.0-SNAPSHOT</version>
> <relativePath/>
> </parent>
> ...
> <properties>
> <root.pom>wild-parent</root.pom>
> </properties>
>
> Added a minimalistic project which shows a crude approach to solve this by
> patching the parent POM via sed:
> https://github.com/m2spring/wild-inhouse-hybrid-example
>
> -Max
>
>
> ---------------------------------------------------------------------
> 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: "conditional" parent POM?
Posted by Max Spring <m2...@springdot.org>.
In this case I actually want to add something, or to be precise, I want my Jenkins job to add something on the fly with each build.
So I can build an open source project deploying to my organization's repository manager.
The property approach Manfred pointed out earlier seems to be the most straight forward.
-Max
On 03/10/2016 06:03 PM, Robert Patrick wrote:
> The flatten plugin can remove sections of the POM that are not needed by consumers of your software binaries, such as the repositories and pluginRepositories sections. Isn't that what you are trying to achieve?
>
> Robert Patrick
> Sent from my iDevice
>
>> On Mar 10, 2016, at 4:29 PM, Manfred Moser <ma...@simpligility.com> wrote:
>>
>> How so? The flatten plugin just flattens the poms right. If they point to an internal repo manager .. its still wrong..
>>
>> Manfred
>>
>> Robert Patrick wrote on 2016-03-10 14:43:
>>
>>> Take a look at the flatten plugin...this is a much simpler way to solve that
>>> problem!
>>>
>>> Robert Patrick
>>> Sent from my iDevice
>>>
>>>> On Mar 10, 2016, at 2:38 PM, Max Spring <m2...@springdot.org> wrote:
>>>>
>>>> Hi Curtis,
>>>>
>>>> I don't want to have the URL of my in-house Maven repository manager out in
>>>> the open.
>>>>
>>>> Regards,
>>>> -Max
>>>>
>>>>
>>>>> On 03/10/2016 12:29 PM, Curtis Rueden wrote:
>>>>> Hi Max,
>>>>>
>>>>> Why do you need two different parents? What configuration is different
>>>>> between your "wild" parent and your internal one?
>>>>>
>>>>> Would it be sufficient to enclose the internal-specific configuration
>>>>> (e.g., distributionManagement) in a profile? This technique is what my OSS
>>>>> projects do [1].
>>>>>
>>>>> Regards,
>>>>> Curtis
>>>>>
>>>>> [1]
>>>>> https://github.com/scijava/pom-scijava/blob/pom-scijava-9.6.0/pom.xml#L1686-L1701
>>>>>
>>>>>
>>>>>> On Thu, Mar 10, 2016 at 2:20 PM, Max Spring <m2...@springdot.org> wrote:
>>>>>>
>>>>>> What's the best structure for a (multi-module) Maven project which should
>>>>>> build "in the wild" without any Maven repository manager and can easily
>>>>>> build within my organization where deployments should happen to my Maven
>>>>>> repository manager?
>>>>>>
>>>>>> Ideally, I would have two different paren POMs for each situation. But
>>>>>> unfortunately, I can't use a Maven property to pass the correct value for
>>>>>> each situation, because the property expression in the parent POM reference
>>>>>> doesn't get interpolated, if I try something like
>>>>>>
>>>>>> <parent>
>>>>>> <groupId>org.example</groupId>
>>>>>> <artifactId>${root.pom}</artifactId>
>>>>>> <version>1.0-SNAPSHOT</version>
>>>>>> <relativePath/>
>>>>>> </parent>
>>>>>> ...
>>>>>> <properties>
>>>>>> <root.pom>wild-parent</root.pom>
>>>>>> </properties>
>>>>>>
>>>>>> Added a minimalistic project which shows a crude approach to solve this by
>>>>>> patching the parent POM via sed:
>>>>>> https://github.com/m2spring/wild-inhouse-hybrid-example
>>>>>>
>>>>>> -Max
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>
> ---------------------------------------------------------------------
> 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: "conditional" parent POM?
Posted by Robert Patrick <ro...@oracle.com>.
The flatten plugin can remove sections of the POM that are not needed by consumers of your software binaries, such as the repositories and pluginRepositories sections. Isn't that what you are trying to achieve?
Robert Patrick
Sent from my iDevice
> On Mar 10, 2016, at 4:29 PM, Manfred Moser <ma...@simpligility.com> wrote:
>
> How so? The flatten plugin just flattens the poms right. If they point to an internal repo manager .. its still wrong..
>
> Manfred
>
> Robert Patrick wrote on 2016-03-10 14:43:
>
>> Take a look at the flatten plugin...this is a much simpler way to solve that
>> problem!
>>
>> Robert Patrick
>> Sent from my iDevice
>>
>>> On Mar 10, 2016, at 2:38 PM, Max Spring <m2...@springdot.org> wrote:
>>>
>>> Hi Curtis,
>>>
>>> I don't want to have the URL of my in-house Maven repository manager out in
>>> the open.
>>>
>>> Regards,
>>> -Max
>>>
>>>
>>>> On 03/10/2016 12:29 PM, Curtis Rueden wrote:
>>>> Hi Max,
>>>>
>>>> Why do you need two different parents? What configuration is different
>>>> between your "wild" parent and your internal one?
>>>>
>>>> Would it be sufficient to enclose the internal-specific configuration
>>>> (e.g., distributionManagement) in a profile? This technique is what my OSS
>>>> projects do [1].
>>>>
>>>> Regards,
>>>> Curtis
>>>>
>>>> [1]
>>>> https://github.com/scijava/pom-scijava/blob/pom-scijava-9.6.0/pom.xml#L1686-L1701
>>>>
>>>>
>>>>> On Thu, Mar 10, 2016 at 2:20 PM, Max Spring <m2...@springdot.org> wrote:
>>>>>
>>>>> What's the best structure for a (multi-module) Maven project which should
>>>>> build "in the wild" without any Maven repository manager and can easily
>>>>> build within my organization where deployments should happen to my Maven
>>>>> repository manager?
>>>>>
>>>>> Ideally, I would have two different paren POMs for each situation. But
>>>>> unfortunately, I can't use a Maven property to pass the correct value for
>>>>> each situation, because the property expression in the parent POM reference
>>>>> doesn't get interpolated, if I try something like
>>>>>
>>>>> <parent>
>>>>> <groupId>org.example</groupId>
>>>>> <artifactId>${root.pom}</artifactId>
>>>>> <version>1.0-SNAPSHOT</version>
>>>>> <relativePath/>
>>>>> </parent>
>>>>> ...
>>>>> <properties>
>>>>> <root.pom>wild-parent</root.pom>
>>>>> </properties>
>>>>>
>>>>> Added a minimalistic project which shows a crude approach to solve this by
>>>>> patching the parent POM via sed:
>>>>> https://github.com/m2spring/wild-inhouse-hybrid-example
>>>>>
>>>>> -Max
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>
>> ---------------------------------------------------------------------
>> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: "conditional" parent POM?
Posted by Manfred Moser <ma...@simpligility.com>.
How so? The flatten plugin just flattens the poms right. If they point to an internal repo manager .. its still wrong..
Manfred
Robert Patrick wrote on 2016-03-10 14:43:
> Take a look at the flatten plugin...this is a much simpler way to solve that
> problem!
>
> Robert Patrick
> Sent from my iDevice
>
>> On Mar 10, 2016, at 2:38 PM, Max Spring <m2...@springdot.org> wrote:
>>
>> Hi Curtis,
>>
>> I don't want to have the URL of my in-house Maven repository manager out in
>> the open.
>>
>> Regards,
>> -Max
>>
>>
>>> On 03/10/2016 12:29 PM, Curtis Rueden wrote:
>>> Hi Max,
>>>
>>> Why do you need two different parents? What configuration is different
>>> between your "wild" parent and your internal one?
>>>
>>> Would it be sufficient to enclose the internal-specific configuration
>>> (e.g., distributionManagement) in a profile? This technique is what my OSS
>>> projects do [1].
>>>
>>> Regards,
>>> Curtis
>>>
>>> [1]
>>> https://github.com/scijava/pom-scijava/blob/pom-scijava-9.6.0/pom.xml#L1686-L1701
>>>
>>>
>>>> On Thu, Mar 10, 2016 at 2:20 PM, Max Spring <m2...@springdot.org> wrote:
>>>>
>>>> What's the best structure for a (multi-module) Maven project which should
>>>> build "in the wild" without any Maven repository manager and can easily
>>>> build within my organization where deployments should happen to my Maven
>>>> repository manager?
>>>>
>>>> Ideally, I would have two different paren POMs for each situation. But
>>>> unfortunately, I can't use a Maven property to pass the correct value for
>>>> each situation, because the property expression in the parent POM reference
>>>> doesn't get interpolated, if I try something like
>>>>
>>>> <parent>
>>>> <groupId>org.example</groupId>
>>>> <artifactId>${root.pom}</artifactId>
>>>> <version>1.0-SNAPSHOT</version>
>>>> <relativePath/>
>>>> </parent>
>>>> ...
>>>> <properties>
>>>> <root.pom>wild-parent</root.pom>
>>>> </properties>
>>>>
>>>> Added a minimalistic project which shows a crude approach to solve this by
>>>> patching the parent POM via sed:
>>>> https://github.com/m2spring/wild-inhouse-hybrid-example
>>>>
>>>> -Max
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>
>
> ---------------------------------------------------------------------
> 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: "conditional" parent POM?
Posted by Robert Patrick <ro...@oracle.com>.
Take a look at the flatten plugin...this is a much simpler way to solve that problem!
Robert Patrick
Sent from my iDevice
> On Mar 10, 2016, at 2:38 PM, Max Spring <m2...@springdot.org> wrote:
>
> Hi Curtis,
>
> I don't want to have the URL of my in-house Maven repository manager out in the open.
>
> Regards,
> -Max
>
>
>> On 03/10/2016 12:29 PM, Curtis Rueden wrote:
>> Hi Max,
>>
>> Why do you need two different parents? What configuration is different
>> between your "wild" parent and your internal one?
>>
>> Would it be sufficient to enclose the internal-specific configuration
>> (e.g., distributionManagement) in a profile? This technique is what my OSS
>> projects do [1].
>>
>> Regards,
>> Curtis
>>
>> [1]
>> https://github.com/scijava/pom-scijava/blob/pom-scijava-9.6.0/pom.xml#L1686-L1701
>>
>>
>>> On Thu, Mar 10, 2016 at 2:20 PM, Max Spring <m2...@springdot.org> wrote:
>>>
>>> What's the best structure for a (multi-module) Maven project which should
>>> build "in the wild" without any Maven repository manager and can easily
>>> build within my organization where deployments should happen to my Maven
>>> repository manager?
>>>
>>> Ideally, I would have two different paren POMs for each situation. But
>>> unfortunately, I can't use a Maven property to pass the correct value for
>>> each situation, because the property expression in the parent POM reference
>>> doesn't get interpolated, if I try something like
>>>
>>> <parent>
>>> <groupId>org.example</groupId>
>>> <artifactId>${root.pom}</artifactId>
>>> <version>1.0-SNAPSHOT</version>
>>> <relativePath/>
>>> </parent>
>>> ...
>>> <properties>
>>> <root.pom>wild-parent</root.pom>
>>> </properties>
>>>
>>> Added a minimalistic project which shows a crude approach to solve this by
>>> patching the parent POM via sed:
>>> https://github.com/m2spring/wild-inhouse-hybrid-example
>>>
>>> -Max
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: [EXTERNAL] Re: "conditional" parent POM?
Posted by Justin Georgeson <JG...@lgc.com>.
Use a property for the URL, with the default in the pom set to a public Maven repository, and then in your settings.xml have a profile that sets the property to your internal repo URL, and activate the profile with the <activeProfiles> section of the settings.xml
> -----Original Message-----
> From: Max Spring [mailto:m2spring@springdot.org]
> Sent: Thursday, March 10, 2016 4:39 PM
> To: users@maven.apache.org
> Subject: [EXTERNAL] Re: "conditional" parent POM?
>
> Hi Curtis,
>
> I don't want to have the URL of my in-house Maven repository manager out
> in the open.
>
> Regards,
> -Max
>
>
> On 03/10/2016 12:29 PM, Curtis Rueden wrote:
> > Hi Max,
> >
> > Why do you need two different parents? What configuration is different
> > between your "wild" parent and your internal one?
> >
> > Would it be sufficient to enclose the internal-specific configuration
> > (e.g., distributionManagement) in a profile? This technique is what my
> > OSS projects do [1].
> >
> > Regards,
> > Curtis
> >
> > [1]
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_scijav
> > a_pom-2Dscijava_blob_pom-2Dscijava-2D9.6.0_pom.xml-23L1686-
> 2DL1701&d=C
> > wICaQ&c=PskvixtEUDK7wuWU-
> tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7
> > uKz_OVZL1uyui4QoEmBCjCmEiTk&m=q26B8pPsbJBwPvNe2YgwT4-
> T7fxuX6KEhm9sVrJS
> > KWs&s=jNLyxJFuERJhA4bv_2IVAUFuReUhwN4Btuj-I7G5QMo&e=
> >
> >
> > On Thu, Mar 10, 2016 at 2:20 PM, Max Spring <m2...@springdot.org>
> wrote:
> >
> >> What's the best structure for a (multi-module) Maven project which
> >> should build "in the wild" without any Maven repository manager and
> >> can easily build within my organization where deployments should
> >> happen to my Maven repository manager?
> >>
> >> Ideally, I would have two different paren POMs for each situation.
> >> But unfortunately, I can't use a Maven property to pass the correct
> >> value for each situation, because the property expression in the
> >> parent POM reference doesn't get interpolated, if I try something
> >> like
> >>
> >> <parent>
> >> <groupId>org.example</groupId>
> >> <artifactId>${root.pom}</artifactId>
> >> <version>1.0-SNAPSHOT</version>
> >> <relativePath/>
> >> </parent>
> >> ...
> >> <properties>
> >> <root.pom>wild-parent</root.pom>
> >> </properties>
> >>
> >> Added a minimalistic project which shows a crude approach to solve
> >> this by patching the parent POM via sed:
> >> https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__github.com_m2spr
> >> ing_wild-2Dinhouse-2Dhybrid-
> 2Dexample&d=CwICaQ&c=PskvixtEUDK7wuWU-tIg
> >>
> 6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEm
> BCjCmEiTk
> >> &m=q26B8pPsbJBwPvNe2YgwT4-
> T7fxuX6KEhm9sVrJSKWs&s=T9sLgQIupfXCVV3jLJgO
> >> Jm0tcc8qulu_xD4TN7YyI5Q&e=
> >>
> >> -Max
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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: "conditional" parent POM?
Posted by Max Spring <m2...@springdot.org>.
Hi Curtis,
I don't want to have the URL of my in-house Maven repository manager out in the open.
Regards,
-Max
On 03/10/2016 12:29 PM, Curtis Rueden wrote:
> Hi Max,
>
> Why do you need two different parents? What configuration is different
> between your "wild" parent and your internal one?
>
> Would it be sufficient to enclose the internal-specific configuration
> (e.g., distributionManagement) in a profile? This technique is what my OSS
> projects do [1].
>
> Regards,
> Curtis
>
> [1]
> https://github.com/scijava/pom-scijava/blob/pom-scijava-9.6.0/pom.xml#L1686-L1701
>
>
> On Thu, Mar 10, 2016 at 2:20 PM, Max Spring <m2...@springdot.org> wrote:
>
>> What's the best structure for a (multi-module) Maven project which should
>> build "in the wild" without any Maven repository manager and can easily
>> build within my organization where deployments should happen to my Maven
>> repository manager?
>>
>> Ideally, I would have two different paren POMs for each situation. But
>> unfortunately, I can't use a Maven property to pass the correct value for
>> each situation, because the property expression in the parent POM reference
>> doesn't get interpolated, if I try something like
>>
>> <parent>
>> <groupId>org.example</groupId>
>> <artifactId>${root.pom}</artifactId>
>> <version>1.0-SNAPSHOT</version>
>> <relativePath/>
>> </parent>
>> ...
>> <properties>
>> <root.pom>wild-parent</root.pom>
>> </properties>
>>
>> Added a minimalistic project which shows a crude approach to solve this by
>> patching the parent POM via sed:
>> https://github.com/m2spring/wild-inhouse-hybrid-example
>>
>> -Max
>>
>>
>> ---------------------------------------------------------------------
>> 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: "conditional" parent POM?
Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Max,
Why do you need two different parents? What configuration is different
between your "wild" parent and your internal one?
Would it be sufficient to enclose the internal-specific configuration
(e.g., distributionManagement) in a profile? This technique is what my OSS
projects do [1].
Regards,
Curtis
[1]
https://github.com/scijava/pom-scijava/blob/pom-scijava-9.6.0/pom.xml#L1686-L1701
On Thu, Mar 10, 2016 at 2:20 PM, Max Spring <m2...@springdot.org> wrote:
> What's the best structure for a (multi-module) Maven project which should
> build "in the wild" without any Maven repository manager and can easily
> build within my organization where deployments should happen to my Maven
> repository manager?
>
> Ideally, I would have two different paren POMs for each situation. But
> unfortunately, I can't use a Maven property to pass the correct value for
> each situation, because the property expression in the parent POM reference
> doesn't get interpolated, if I try something like
>
> <parent>
> <groupId>org.example</groupId>
> <artifactId>${root.pom}</artifactId>
> <version>1.0-SNAPSHOT</version>
> <relativePath/>
> </parent>
> ...
> <properties>
> <root.pom>wild-parent</root.pom>
> </properties>
>
> Added a minimalistic project which shows a crude approach to solve this by
> patching the parent POM via sed:
> https://github.com/m2spring/wild-inhouse-hybrid-example
>
> -Max
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>