You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Petar Tahchiev <pa...@gmail.com> on 2016/05/03 16:10:08 UTC

Maven Release Plugin And A BOM

Hi guys,

I have a question regarding the release plugin. In my project I have a BOM
in which I declare a property and a dependencyManagement section:

<groupId>com.mycompany</groupId>
<artifactId>my-bom</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
    <platform.version>1.0-SNAPSHOT</platform.version>
</properties>

<dependencyManagement>
   <dependencies>
      <groupId>com.mycompany</groupId>
      <artifactId>platform</artifactId>
      <version>${platform.version}</version>
  </dependencies>
</dependencyManagement>


and I also have 3 different projects that declare this BOM as their parent.
All of these projects have the same version number (1.0-SNAPSHOT) and when
I make a release I always release all of them. This is how it looks like:
1) I change platform.version property to 1.0, commit, push and release the
bom.
2) I try to release first of my other projects and now the release plugin
is asking me to resolve the version of the BOM. Ok, fair enough, I resolve
it to 1.0 but then it asks me again to resolve the version of
com.mycompany:platform. This clearly is a bug right? I have changed it to
1.0 before so it is no longer a SNAPSHOT???
If you think this is a problem, I will submit it in the JIRA and try to fix
it. I'm just not sure if it's a bug or maybe it's a known issue, or maybe
that's how it is supposed to be.

-- 
Regards, Petar!
Karlovo, Bulgaria.
---
Public PGP Key at:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x19658550C3110611
Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611

Re: Maven Release Plugin And A BOM

Posted by Petar Tahchiev <pa...@gmail.com>.
Yeah,

I guess I feel the same and that's why I wanted to consult the dev list
first before raising a JIRA.

2016-05-03 23:21 GMT+02:00 Jörg Schaible <jo...@gmx.de>:

> Hi Petar,
>
> Petar Tahchiev wrote:
>
> > Hi all,
> >
> > @Uwe - the enforcer rules are great, but I don't think I need them.
> > @Jorg - Resolving the parent during release:prepare is fine. What I don't
> > like is that it also asks me to resolve the platform version.
>
> The point is, that Maven does not recreate the effective POM to build again
> the list of versions to resolve. It's simply a corner case. Some might
> argue
> it is undefined behavior, others might say it's a bug ;-)
>
> Cheers,
> Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


-- 
Regards, Petar!
Karlovo, Bulgaria.
---
Public PGP Key at:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x19658550C3110611
Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611

Re: Maven Release Plugin And A BOM

Posted by Jörg Schaible <jo...@gmx.de>.
Hi Petar,

Petar Tahchiev wrote:

> Hi all,
> 
> @Uwe - the enforcer rules are great, but I don't think I need them.
> @Jorg - Resolving the parent during release:prepare is fine. What I don't
> like is that it also asks me to resolve the platform version.

The point is, that Maven does not recreate the effective POM to build again 
the list of versions to resolve. It's simply a corner case. Some might argue 
it is undefined behavior, others might say it's a bug ;-)

Cheers,
J�rg


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


Re: Maven Release Plugin And A BOM

Posted by Petar Tahchiev <pa...@gmail.com>.
Hi all,

@Uwe - the enforcer rules are great, but I don't think I need them.
@Jorg - Resolving the parent during release:prepare is fine. What I don't
like is that it also asks me to resolve the platform version.

I'll go with Robert's suggestion.

2016-05-03 19:51 GMT+03:00 Jörg Schaible <jo...@gmx.de>:

> Petar Tahchiev wrote:
>
> > Hi guys,
> >
> > I have a question regarding the release plugin. In my project I have a
> BOM
> > in which I declare a property and a dependencyManagement section:
> >
> > <groupId>com.mycompany</groupId>
> > <artifactId>my-bom</artifactId>
> > <version>1.0-SNAPSHOT</version>
> >
> > <properties>
> >     <platform.version>1.0-SNAPSHOT</platform.version>
> > </properties>
> >
> > <dependencyManagement>
> >    <dependencies>
> >       <groupId>com.mycompany</groupId>
> >       <artifactId>platform</artifactId>
> >       <version>${platform.version}</version>
> >   </dependencies>
> > </dependencyManagement>
> >
> >
> > and I also have 3 different projects that declare this BOM as their
> > parent. All of these projects have the same version number (1.0-SNAPSHOT)
> > and when I make a release I always release all of them. This is how it
> > looks like: 1) I change platform.version property to 1.0, commit, push
> and
> > release the bom.
> > 2) I try to release first of my other projects and now the release plugin
> > is asking me to resolve the version of the BOM. Ok, fair enough, I
> resolve
> > it to 1.0 but then it asks me again to resolve the version of
> > com.mycompany:platform. This clearly is a bug right? I have changed it to
> > 1.0 before so it is no longer a SNAPSHOT???
> > If you think this is a problem, I will submit it in the JIRA and try to
> > fix it. I'm just not sure if it's a bug or maybe it's a known issue, or
> > maybe that's how it is supposed to be.
>
> You mean, you let the release plugin resolve the parent? We always manually
> "resolved" the parent first...
>
> Cheers,
> Jörg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


-- 
Regards, Petar!
Karlovo, Bulgaria.
---
Public PGP Key at:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x19658550C3110611
Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611

Re: Maven Release Plugin And A BOM

Posted by Jörg Schaible <jo...@gmx.de>.
Petar Tahchiev wrote:

> Hi guys,
> 
> I have a question regarding the release plugin. In my project I have a BOM
> in which I declare a property and a dependencyManagement section:
> 
> <groupId>com.mycompany</groupId>
> <artifactId>my-bom</artifactId>
> <version>1.0-SNAPSHOT</version>
> 
> <properties>
>     <platform.version>1.0-SNAPSHOT</platform.version>
> </properties>
> 
> <dependencyManagement>
>    <dependencies>
>       <groupId>com.mycompany</groupId>
>       <artifactId>platform</artifactId>
>       <version>${platform.version}</version>
>   </dependencies>
> </dependencyManagement>
> 
> 
> and I also have 3 different projects that declare this BOM as their
> parent. All of these projects have the same version number (1.0-SNAPSHOT)
> and when I make a release I always release all of them. This is how it
> looks like: 1) I change platform.version property to 1.0, commit, push and
> release the bom.
> 2) I try to release first of my other projects and now the release plugin
> is asking me to resolve the version of the BOM. Ok, fair enough, I resolve
> it to 1.0 but then it asks me again to resolve the version of
> com.mycompany:platform. This clearly is a bug right? I have changed it to
> 1.0 before so it is no longer a SNAPSHOT???
> If you think this is a problem, I will submit it in the JIRA and try to
> fix it. I'm just not sure if it's a bug or maybe it's a known issue, or
> maybe that's how it is supposed to be.

You mean, you let the release plugin resolve the parent? We always manually 
"resolved" the parent first...

Cheers,
J�rg



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


Re: Maven Release Plugin And A BOM

Posted by Uwe Barthel <ba...@x-reizend.de>.
Hi Petar,

I found a very old enforcer rule at smartics and asked them to provide 
these as OS.
They did it two weeks ago at github under Apache Software License. :-)

Take a look at https://github.com/smartics/smartics-enforcer-rules

-- barthel



On May 3, 2016 4:25:55 PM Petar Tahchiev <pa...@gmail.com> wrote:

> Hi Robert,
>
> thank you for your comment. The idea behind the property was that I also
> give the BOM to my clients and they declare it as their parent. So now if
> they want to use a newer version of the platform, all they have to do
> is redeclare the property <platform.version> to be 1.2 or 1.5 or whatever
> they want. Otherwise they will have to re-declare the whole dependency.
>
> Now that I think about it I was wrong - if my clients want to update the
> platform version all they have to do is update version of the parent BOM.
>
> I still think though that this is a bug.
>
>
> 2016-05-03 16:17 GMT+02:00 Robert Patrick <ro...@oracle.com>:
>
>> Why bother with the custom property?  Do this instead and the release
>> plugin is happy:
>>
>> <groupId>com.mycompany</groupId>
>> <artifactId>my-bom</artifactId>
>> <version>1.0-SNAPSHOT</version>
>>
>> <dependencyManagement>
>>    <dependencies>
>>       <groupId>com.mycompany</groupId>
>>       <artifactId>platform</artifactId>
>>       <version>${project.version}</version>
>>   </dependencies>
>> </dependencyManagement>
>>
>>
>>
>> -----Original Message-----
>> From: Petar Tahchiev [mailto:paranoiabla@gmail.com]
>> Sent: Tuesday, May 03, 2016 9:10 AM
>> To: Maven Developers List
>> Subject: Maven Release Plugin And A BOM
>>
>> Hi guys,
>>
>> I have a question regarding the release plugin. In my project I have a BOM
>> in which I declare a property and a dependencyManagement section:
>>
>> <groupId>com.mycompany</groupId>
>> <artifactId>my-bom</artifactId>
>> <version>1.0-SNAPSHOT</version>
>>
>> <properties>
>>     <platform.version>1.0-SNAPSHOT</platform.version>
>> </properties>
>>
>> <dependencyManagement>
>>    <dependencies>
>>       <groupId>com.mycompany</groupId>
>>       <artifactId>platform</artifactId>
>>       <version>${platform.version}</version>
>>   </dependencies>
>> </dependencyManagement>
>>
>>
>> and I also have 3 different projects that declare this BOM as their parent.
>> All of these projects have the same version number (1.0-SNAPSHOT) and when
>> I make a release I always release all of them. This is how it looks like:
>> 1) I change platform.version property to 1.0, commit, push and release the
>> bom.
>> 2) I try to release first of my other projects and now the release plugin
>> is asking me to resolve the version of the BOM. Ok, fair enough, I resolve
>> it to 1.0 but then it asks me again to resolve the version of
>> com.mycompany:platform. This clearly is a bug right? I have changed it to
>> 1.0 before so it is no longer a SNAPSHOT???
>> If you think this is a problem, I will submit it in the JIRA and try to
>> fix it. I'm just not sure if it's a bug or maybe it's a known issue, or
>> maybe that's how it is supposed to be.
>>
>> --
>> Regards, Petar!
>> Karlovo, Bulgaria.
>> ---
>> Public PGP Key at:
>> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x19658550C3110611
>> Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
>
> --
> Regards, Petar!
> Karlovo, Bulgaria.
> ---
> Public PGP Key at:
> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x19658550C3110611
> Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611



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


Re: Maven Release Plugin And A BOM

Posted by Petar Tahchiev <pa...@gmail.com>.
Hi Robert,

thank you for your comment. The idea behind the property was that I also
give the BOM to my clients and they declare it as their parent. So now if
they want to use a newer version of the platform, all they have to do
is redeclare the property <platform.version> to be 1.2 or 1.5 or whatever
they want. Otherwise they will have to re-declare the whole dependency.

Now that I think about it I was wrong - if my clients want to update the
platform version all they have to do is update version of the parent BOM.

I still think though that this is a bug.


2016-05-03 16:17 GMT+02:00 Robert Patrick <ro...@oracle.com>:

> Why bother with the custom property?  Do this instead and the release
> plugin is happy:
>
> <groupId>com.mycompany</groupId>
> <artifactId>my-bom</artifactId>
> <version>1.0-SNAPSHOT</version>
>
> <dependencyManagement>
>    <dependencies>
>       <groupId>com.mycompany</groupId>
>       <artifactId>platform</artifactId>
>       <version>${project.version}</version>
>   </dependencies>
> </dependencyManagement>
>
>
>
> -----Original Message-----
> From: Petar Tahchiev [mailto:paranoiabla@gmail.com]
> Sent: Tuesday, May 03, 2016 9:10 AM
> To: Maven Developers List
> Subject: Maven Release Plugin And A BOM
>
> Hi guys,
>
> I have a question regarding the release plugin. In my project I have a BOM
> in which I declare a property and a dependencyManagement section:
>
> <groupId>com.mycompany</groupId>
> <artifactId>my-bom</artifactId>
> <version>1.0-SNAPSHOT</version>
>
> <properties>
>     <platform.version>1.0-SNAPSHOT</platform.version>
> </properties>
>
> <dependencyManagement>
>    <dependencies>
>       <groupId>com.mycompany</groupId>
>       <artifactId>platform</artifactId>
>       <version>${platform.version}</version>
>   </dependencies>
> </dependencyManagement>
>
>
> and I also have 3 different projects that declare this BOM as their parent.
> All of these projects have the same version number (1.0-SNAPSHOT) and when
> I make a release I always release all of them. This is how it looks like:
> 1) I change platform.version property to 1.0, commit, push and release the
> bom.
> 2) I try to release first of my other projects and now the release plugin
> is asking me to resolve the version of the BOM. Ok, fair enough, I resolve
> it to 1.0 but then it asks me again to resolve the version of
> com.mycompany:platform. This clearly is a bug right? I have changed it to
> 1.0 before so it is no longer a SNAPSHOT???
> If you think this is a problem, I will submit it in the JIRA and try to
> fix it. I'm just not sure if it's a bug or maybe it's a known issue, or
> maybe that's how it is supposed to be.
>
> --
> Regards, Petar!
> Karlovo, Bulgaria.
> ---
> Public PGP Key at:
> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x19658550C3110611
> Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


-- 
Regards, Petar!
Karlovo, Bulgaria.
---
Public PGP Key at:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x19658550C3110611
Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611

RE: Maven Release Plugin And A BOM

Posted by Robert Patrick <ro...@oracle.com>.
Why bother with the custom property?  Do this instead and the release plugin is happy:

<groupId>com.mycompany</groupId>
<artifactId>my-bom</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencyManagement>
   <dependencies>
      <groupId>com.mycompany</groupId>
      <artifactId>platform</artifactId>
      <version>${project.version}</version>
  </dependencies>
</dependencyManagement>
 


-----Original Message-----
From: Petar Tahchiev [mailto:paranoiabla@gmail.com] 
Sent: Tuesday, May 03, 2016 9:10 AM
To: Maven Developers List
Subject: Maven Release Plugin And A BOM

Hi guys,

I have a question regarding the release plugin. In my project I have a BOM in which I declare a property and a dependencyManagement section:

<groupId>com.mycompany</groupId>
<artifactId>my-bom</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
    <platform.version>1.0-SNAPSHOT</platform.version>
</properties>

<dependencyManagement>
   <dependencies>
      <groupId>com.mycompany</groupId>
      <artifactId>platform</artifactId>
      <version>${platform.version}</version>
  </dependencies>
</dependencyManagement>


and I also have 3 different projects that declare this BOM as their parent.
All of these projects have the same version number (1.0-SNAPSHOT) and when I make a release I always release all of them. This is how it looks like:
1) I change platform.version property to 1.0, commit, push and release the bom.
2) I try to release first of my other projects and now the release plugin is asking me to resolve the version of the BOM. Ok, fair enough, I resolve it to 1.0 but then it asks me again to resolve the version of com.mycompany:platform. This clearly is a bug right? I have changed it to
1.0 before so it is no longer a SNAPSHOT???
If you think this is a problem, I will submit it in the JIRA and try to fix it. I'm just not sure if it's a bug or maybe it's a known issue, or maybe that's how it is supposed to be.

--
Regards, Petar!
Karlovo, Bulgaria.
---
Public PGP Key at:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x19658550C3110611
Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611

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