[ 
https://issues.apache.org/jira/browse/FLINK-19164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17192484#comment-17192484
 ] 

Serhat Soydan edited comment on FLINK-19164 at 9/8/20, 9:13 PM:
----------------------------------------------------------------

[~rmetzger], thanks for the comment. Although it is only a helper script and 
the results are reviewed by many eyes for the official release process, it 
still exists in the project and open to use for people that may use it within 
forked repos or other cases. The possible side effect is not clear and everyone 
should be able to somehow use it without worrying that it may break. Actually 
we experienced the issue in our project and spent hours trying to figure out 
where the problem is (there are around 185 poms that needs to be reviewed).

The below line seem to update versions of all modules in the project (within 
pom files) by a manual find & replace:
 {color:#de350b}find . -name 'pom.xml' -type f -exec perl -pi -e 
's#<version>(.*)'$OLD_VERSION'(.*)</version>#<version>${1}'$NEW_VERSION'${2}</version>#'
 {} \;{color}

*A possible solution is to replace it with "versions maven plugin" and running 
the command below within the script (tried it locally and it seems to work 
properly):*

{color:#de350b}mvn versions:set -DnewVersion=$NEW_VERSION 
-DprocessAllModules{color}

or use it directly in the script only without adding the plugin to the project

{color:#de350b}mvn org.codehaus.mojo:versions-maven-plugin:2.8.1:set 
-DnewVersion=$NEW_VERSION -DprocessAllModules{color}


was (Author: ssoydan):
[~rmetzger], thanks for the comment. Although it is only a helper script and 
the results are reviewed by many eyes for the official release process, it 
still exists in the project and open to use for people that may use it within 
forked repos or other cases. The possible side effect is not clear and everyone 
should be able to somehow use it without worrying that it may break. Actually 
we experienced the issue in our project and spent hours trying to figure out 
where the problem is (there are around 185 poms that needs to be reviewed).

The below line seem to update versions of all modules in the project (within 
pom files) by a manual find & replace:
{color:#de350b}find . -name 'pom.xml' -type f -exec perl -pi -e 
's#<version>(.*)'$OLD_VERSION'(.*)</version>#<version>${1}'$NEW_VERSION'${2}</version>#'
 {} \;{color}

** A possible solution is to replace it with "versions maven plugin" and 
running the command below within the script (tried it locally and it seems to 
work properly)*:

{color:#de350b}mvn versions:set -DnewVersion=$NEW_VERSION 
-DprocessAllModules{color}

or use it directly in the script only without adding the plugin to the project

{color:#de350b}mvn org.codehaus.mojo:versions-maven-plugin:2.8.1:set 
-DnewVersion=$NEW_VERSION -DprocessAllModules{color}

> Release scripts break other dependency versions unintentionally
> ---------------------------------------------------------------
>
>                 Key: FLINK-19164
>                 URL: https://issues.apache.org/jira/browse/FLINK-19164
>             Project: Flink
>          Issue Type: Bug
>          Components: Deployment / Scripts, Release System
>            Reporter: Serhat Soydan
>            Priority: Minor
>
> All the scripts below has a line to change the old version to new version in 
> pom files.
> [https://github.com/apache/flink/blob/master/tools/change-version.sh#L31]
> [https://github.com/apache/flink/blob/master/tools/releasing/create_release_branch.sh#L60]
> [https://github.com/apache/flink/blob/master/tools/releasing/update_branch_version.sh#L52]
>  
> It works like find & replace so it is prone to unintentional errors. Any 
> dependency with a version equals to "old version" might be automatically 
> changed to "new version". See below to see how to produce a similar case. 
>  
> +How to re-produce the bug:+
>  * Clone/Fork Flink repo and for example checkout version v*1.11.1* 
>  * Apply any changes you need
>  * Run "create_release_branch.sh" script with OLD_VERSION=*1.11.1* 
> NEW_VERSION={color:#de350b}*1.12.0*{color}
>  ** In parent pom.xml, an auto find&replace of maven-dependency-analyzer 
> version will be done automatically and *unintentionally* which will break the 
> build.
>  
>                         <dependency>
>                             <groupId>org.apache.maven.shared</groupId>
>                             <artifactId>maven-dependency-analyzer</artifactId>
>                             <version>*1.11.1*</version>
>                         </dependency>
>  
>                         <dependency>
>                             <groupId>org.apache.maven.shared</groupId>
>                             <artifactId>maven-dependency-analyzer</artifactId>
>                             <version>{color:#de350b}*1.12.0*{color}</version>
>                         </dependency>



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to