From 8fc3abefc04e6a8ced28b51b86897971a753c25b Mon Sep 17 00:00:00 2001 From: gaozhiming Date: Fri, 7 Jun 2024 09:01:40 +0800 Subject: [PATCH 1/6] add maven profiles for bump major and minor version --- CONTRIBUTING.md | 2 ++ pom.xml | 69 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bb2cdb1..7646fec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,6 +13,8 @@ Dev Tasks Bump maven plugins: `./mvnw versions:display-plugin-updates -pl .` Bump maven wrapper: `./mvnw wrapper:wrapper` +Bump project major version: `./mvnw validate -Pbump-major-version` +Bump project minor version: `./mvnw validate -Pbump-minor-version` Sort pom.xml: `./mvnw sortpom:sort` Release Steps diff --git a/pom.xml b/pom.xml index 34c9af7..3ae212f 100644 --- a/pom.xml +++ b/pom.xml @@ -291,6 +291,16 @@ maven-wrapper-plugin 3.3.2 + + org.codehaus.mojo + build-helper-maven-plugin + 3.6.0 + + + org.codehaus.mojo + versions-maven-plugin + 2.16.2 + @@ -351,6 +361,18 @@ + + org.codehaus.mojo + build-helper-maven-plugin + + + parse-version + + parse-version + + + + @@ -458,6 +480,53 @@ + + + bump-minor-version + + + + org.codehaus.mojo + versions-maven-plugin + + + + set + + validate + false + + ${parsedVersion.majorVersion}.${parsedVersion.nextMinorVersion}.0${parsedVersion.qualifier?} + + + + + + + + + bump-major-version + + + + org.codehaus.mojo + versions-maven-plugin + + + + set + + validate + false + + ${parsedVersion.nextMajorVersion}.0.0${parsedVersion.qualifier?} + + + + + + + From f78398fed5a4ddc803f113a24d988e61533fd1f8 Mon Sep 17 00:00:00 2001 From: gaozhiming Date: Fri, 7 Jun 2024 09:05:20 +0800 Subject: [PATCH 2/6] enable maven mirror for central --- .mvn/settings.xml | 12 ++++++++++++ Jenkinsfile | 12 ++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.mvn/settings.xml b/.mvn/settings.xml index 032e6d5..58e5984 100644 --- a/.mvn/settings.xml +++ b/.mvn/settings.xml @@ -11,4 +11,16 @@ ${mirror.of.proxy} + + + + mirror-central + + true + + + central + + + diff --git a/Jenkinsfile b/Jenkinsfile index 1337a4d..8f2bdf3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,12 +15,12 @@ pipeline { } stage('Lint: Maven Pom Format') { steps { - sh './mvnw -V -B -Dmirror.of.proxy=central sortpom:verify -Dsort.verifyFail=STOP' + sh './mvnw -V -B sortpom:verify -Dsort.verifyFail=STOP' } } stage('Lint: Check Maven Plugins') { steps { - sh './mvnw -V -B -Dmirror.of.proxy=central artifact:check-buildplan' + sh './mvnw -V -B artifact:check-buildplan' } } } @@ -29,7 +29,7 @@ pipeline { stages { stage('Build: Maven Verify') { steps { - sh './mvnw -B -Dmirror.of.proxy=central clean verify' + sh './mvnw -B clean verify' } } stage('Build: Reproducible on tags') { @@ -39,13 +39,13 @@ pipeline { steps { sh ''' set -eux - ./mvnw -B -Dmirror.of.proxy=central clean install -Dmaven.test.skip=true -DskipTests -Dinvoker.skip -Dbuildinfo.detect.skip=false - ./mvnw -B -Dmirror.of.proxy=central clean + ./mvnw -B clean install -Dmaven.test.skip=true -DskipTests -Dinvoker.skip -Dbuildinfo.detect.skip=false + ./mvnw -B clean mkdir -p target true artifact:compare should not contain warning or error trap 'cat target/build.log' ERR - ./mvnw -B -Dmirror.of.proxy=central -l target/build.log package artifact:compare -Dmaven.test.skip=true -DskipTests -Dinvoker.skip -Dbuildinfo.detect.skip=false + ./mvnw -B -l target/build.log package artifact:compare -Dmaven.test.skip=true -DskipTests -Dinvoker.skip -Dbuildinfo.detect.skip=false test 0 = "$(sed -n '/^\\[INFO\\] --- maven-artifact-plugin:[^:][^:]*:compare/,/^\\[INFO\\] ---/ p' target/build.log | grep -c '^\\[\\(WARNING\\|ERROR\\)\\]')" true all files should be ok From 9e4242b311525c13322693fef58388bdeb9a5aa3 Mon Sep 17 00:00:00 2001 From: gaozhiming Date: Fri, 7 Jun 2024 10:09:29 +0800 Subject: [PATCH 3/6] update tests/ver.sh when bumping project version --- pom.xml | 64 +++++++++++++++++++++++++++++++++++++-- src/test/resources/ver.sh | 2 +- 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 3ae212f..756ffee 100644 --- a/pom.xml +++ b/pom.xml @@ -38,6 +38,8 @@ 4.0.0 warn + ${project.version} + true v@{project.version} @@ -483,6 +485,9 @@ bump-minor-version + + ${parsedVersion.majorVersion}.${parsedVersion.nextMinorVersion}.0${parsedVersion.qualifier?} + @@ -490,13 +495,39 @@ versions-maven-plugin + bumping-minor-version set validate false - ${parsedVersion.majorVersion}.${parsedVersion.nextMinorVersion}.0${parsedVersion.qualifier?} + ${project.effective.version} + + + + + + maven-resources-plugin + + + sync-ver-for-tests + + copy-resources + + validate + false + + ${project.basedir}/tests + + + src/test/resources + + ver.sh + + true + + @@ -506,6 +537,9 @@ bump-major-version + + ${parsedVersion.nextMajorVersion}.0.0${parsedVersion.qualifier?} + @@ -513,13 +547,39 @@ versions-maven-plugin + bumping-major-version set validate false - ${parsedVersion.nextMajorVersion}.0.0${parsedVersion.qualifier?} + ${project.effective.version} + + + + + + maven-resources-plugin + + + sync-ver-for-tests + + copy-resources + + validate + false + + ${project.basedir}/tests + + + src/test/resources + + ver.sh + + true + + diff --git a/src/test/resources/ver.sh b/src/test/resources/ver.sh index b9383e9..cfd6f48 100644 --- a/src/test/resources/ver.sh +++ b/src/test/resources/ver.sh @@ -1,2 +1,2 @@ # shellcheck shell=bash disable=SC2034 -HBOX_VERSION=@project.version@ +HBOX_VERSION=@project.effective.version@ From 63c081bc12385da986c727ddd73c7c292dad815e Mon Sep 17 00:00:00 2001 From: gaozhiming Date: Fri, 7 Jun 2024 10:22:17 +0800 Subject: [PATCH 4/6] enable proxy via .mvn/maven.config --- .mvn/maven.config | 1 + .mvn/settings.xml | 14 +------------- 2 files changed, 2 insertions(+), 13 deletions(-) create mode 100644 .mvn/maven.config diff --git a/.mvn/maven.config b/.mvn/maven.config new file mode 100644 index 0000000..304aafd --- /dev/null +++ b/.mvn/maven.config @@ -0,0 +1 @@ +-Dmirror.of.proxy=central diff --git a/.mvn/settings.xml b/.mvn/settings.xml index 58e5984..e78e49e 100644 --- a/.mvn/settings.xml +++ b/.mvn/settings.xml @@ -5,22 +5,10 @@ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> - mediav-proxy + aliyun-proxy Public Maven2 Proxy Repositories https://maven.aliyun.com/repository/central/ ${mirror.of.proxy} - - - - mirror-central - - true - - - central - - - From 19a607f21d7933badb31f9b227771999e3a82db7 Mon Sep 17 00:00:00 2001 From: gaozhiming Date: Fri, 7 Jun 2024 14:44:57 +0800 Subject: [PATCH 5/6] update CONTRIBUTING.md --- CONTRIBUTING.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7646fec..bea17a3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,11 +28,12 @@ Release Steps # run on gateways # 3. prepare release version, git tag and next version -./mvnw release:clean release:prepare +./mvnw release:clean release:prepare -DpushChanges=false -# 4. cleanup -./mvnw release:clean +# 4. push to git repo +git push --follow-tags -# 5. sync with the remote repo +# 5. cleanup and sync with the remote repo +./mvnw release:clean git fetch ``` From 745768ffef914074a5203c229562b43869cea8dd Mon Sep 17 00:00:00 2001 From: gaozhiming Date: Fri, 7 Jun 2024 14:54:43 +0800 Subject: [PATCH 6/6] prepare project version 1.8.0-SNAPSHOT --- common/pom.xml | 2 +- core/pom.xml | 2 +- history-server/pom.xml | 2 +- pom.xml | 4 ++-- tests/ver.sh | 2 +- web/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/pom.xml b/common/pom.xml index 0543de3..f891b35 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -5,7 +5,7 @@ net.qihoo hbox-parent - 1.7.3-SNAPSHOT + 1.8.0-SNAPSHOT hbox-common diff --git a/core/pom.xml b/core/pom.xml index 11b7be5..466e762 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -5,7 +5,7 @@ net.qihoo hbox-parent - 1.7.3-SNAPSHOT + 1.8.0-SNAPSHOT hbox-core diff --git a/history-server/pom.xml b/history-server/pom.xml index 600b4aa..59b5ee5 100644 --- a/history-server/pom.xml +++ b/history-server/pom.xml @@ -5,7 +5,7 @@ net.qihoo hbox-parent - 1.7.3-SNAPSHOT + 1.8.0-SNAPSHOT hbox-history-server diff --git a/pom.xml b/pom.xml index 756ffee..8150fd5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ net.qihoo hbox-parent - 1.7.3-SNAPSHOT + 1.8.0-SNAPSHOT pom HBox Parent Pom @@ -26,7 +26,7 @@ 3.6.3 UTF-8 - 2024-06-04T08:11:48Z + 2024-06-07T06:53:32Z