This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 47f57b0  Protobuf-shaded package can not update version (#7228)
47f57b0 is described below

commit 47f57b085ef5f59ac48567b4dc64336de881d7ed
Author: Yong Zhang <[email protected]>
AuthorDate: Fri Jun 12 03:14:00 2020 +0800

    Protobuf-shaded package can not update version (#7228)
    
    * Protobuf-shaeded package can not udpate version
    ---
    
    *Motivation*
    
    Using `set-project-version.sh` always failed with updating
    protobuf-shaded parent version.
    
    error log:
    
    ```
    [INFO] Scanning for projects...
    [ERROR] [ERROR] Some problems were encountered while processing the POMs:
    [FATAL] Non-resolvable parent POM for 
org.apache.pulsar:protobuf-shaded:2.6.0-SNAPSHOT: Could not find artifact 
org.apache.pulsar:pulsar:pom:2.6.0-SNAPSHOT and 'parent.relativePath' points at 
wrong local POM @ line 26, column 11
     @
     [ERROR] The build could not read 1 project > [Help 1]
     [ERROR]
     [ERROR]   The project org.apache.pulsar:protobuf-shaded:2.6.0-SNAPSHOT 
(/home/zhangyong/actions-runner/_work/streamnative-ci/streamnative-ci/pulsar/protobuf-shaded/pom.xml)
 has 1 error
     [ERROR]     Non-resolvable parent POM for 
org.apache.pulsar:protobuf-shaded:2.6.0-SNAPSHOT: Could not find artifact 
org.apache.pulsar:pulsar:pom:2.6.0-SNAPSHOT and 'parent.relativePath' points at 
wrong local POM @ line 26, column 11 > [Help 2]
     [ERROR]
     [ERROR] To see the full stack trace of the errors, re-run Maven with the 
-e switch.
     [ERROR] Re-run Maven using the -X switch to enable full debug logging.
     [ERROR]
     [ERROR] For more information about the errors and possible solutions, 
please read the following articles:
     [ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException-''-''
    ```
    
    * Using 'sed' to replace the old version
    
    * Fix scripts
    
    * Address comments
---
 src/set-project-version.sh | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/set-project-version.sh b/src/set-project-version.sh
index 4cd7d64..83688e1 100755
--- a/src/set-project-version.sh
+++ b/src/set-project-version.sh
@@ -28,14 +28,17 @@ fi
 NEW_VERSION=$1
 
 # Go to top level project directory
-pushd $(dirname "$0")/..
+SRC_DIR=$(dirname "$0")
+ROOT_DIR=`cd ${SRC_DIR}/..; pwd`
+pushd ${ROOT_DIR}
+
+# Get the current version
+OLD_VERSION=`python ${ROOT_DIR}/src/get-project-version.py`
 
 mvn versions:set -DnewVersion=$NEW_VERSION
 mvn versions:set -DnewVersion=$NEW_VERSION -pl buildtools
 mvn versions:set -DnewVersion=$NEW_VERSION -pl pulsar-sql/presto-distribution
 # install the new version of root pom local, so `update-parent` can update the 
right parent version
-mvn -am -pl . clean install -DskipTests
-mvn versions:update-parent -DallowSnapshots=true -DparentVersion=$NEW_VERSION 
-f protobuf-shaded/pom.xml
-mvn versions:set -DnewVersion=$NEW_VERSION -f protobuf-shaded/pom.xml
+sed -i -e "s/${OLD_VERSION}/${NEW_VERSION}/g" protobuf-shaded/pom.xml
 
 popd

Reply via email to