release プラグインでリリースしたものをやり直したい場合。
$ git reset –hard HEAD^
$ git tag -d リリースバージョン名
Deleted tag '2.1.3' (was 247b341)
$ git push origin :refs/tags/リリースバージョン名
To git@github.com:yusuke/twitter4j.git
– [deleted] 2.1.3
$ git push -f origin master
$ mvn release:prepare -Darguments="-Dmaven.test.skip=true"
INFO] Scanning for projects…
[INFO] Reactor build order:
[INFO] twitter4j
[INFO] twitter4j-core
[INFO] twitter4j-httpclient-support
[INFO] twitter4j-examples
[INFO] Searching repository for plugin with prefix: 'release'.
[INFO] ————————————————————————
[INFO] Building twitter4j
[INFO] task-segment: [release:prepare] (aggregator-style)
[INFO] ————————————————————————
[INFO] [release:prepare {execution: default-cli}]
[INFO] Verifying that there are no local modifications…
[INFO] Executing: /bin/sh -c cd /Users/yusukey/opensource/twitter4j && git status
[INFO] Working directory: /Users/yusukey/opensource/twitter4j
[INFO] Checking dependencies and plugins for snapshots …
What is the release version for “twitter4j”? (org.twitter4j:twitter4j) 2.1.3: :
What is the release version for “twitter4j-core”? (org.twitter4j:twitter4j-core) 2.1.3: :
What is the release version for “twitter4j-httpclient-support”? (org.twitter4j:twitter4j-httpclient-support) 2.1.3: :
What is the release version for “twitter4j-examples”? (org.twitter4j:twitter4j-examples) 2.1.3: :
What is SCM release tag or label for “twitter4j”? (org.twitter4j:twitter4j) twitter4j-2.1.3: : 2.1.3
What is the new development version for “twitter4j”? (org.twitter4j:twitter4j) 2.1.4-SNAPSHOT: :
What is the new development version for “twitter4j-core”? (org.twitter4j:twitter4j-core) 2.1.4-SNAPSHOT: :
What is the new development version for “twitter4j-httpclient-support”? (org.twitter4j:twitter4j-httpclient-support) 2.1.4-SNAPSHOT: :
What is the new development version for “twitter4j-examples”? (org.twitter4j:twitter4j-examples) 2.1.4-SNAPSHOT: :
[INFO] Transforming 'twitter4j'…
[INFO] Transforming 'twitter4j-core'…
[INFO] Transforming 'twitter4j-httpclient-support'…
….省略….
$ mvn release:perform -Dgpg.passphrase=************ -Darguments="-Dgpg.passphrase=********** -Dmaven.test.skip=true"
[INFO] Scanning for projects…
[INFO] Reactor build order:
[INFO] twitter4j
[INFO] twitter4j-core
[INFO] twitter4j-httpclient-support
[INFO] twitter4j-examples
[INFO] Searching repository for plugin with prefix: 'release'.
[INFO] ————————————————————————
[INFO] Building twitter4j
[INFO] task-segment: [release:perform] (aggregator-style)
[INFO] ————————————————————————
[INFO] [release:perform {execution: default-cli}]
[INFO] Checking out the project to perform the release …
….省略….
あとは sonatype でリポジトリを選択して"close" → "release"すれば maven central repository に伝わります。
以上自分向けのメモでした。
関連記事:
・clmemo@aka: Git でリモート・リポジトリーのタグを削除する
・歴史を振り返る、歴史を書き換える – Git を勉強してみる (4) – ちからの備忘録的日記