<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-release-plugin --> <dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.5.3</version> <type>jar</type> </dependency> <!-- mvn release:prepare --> <!-- mvn release:perform -Dmaven.javadoc.skip --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.5.3</version> <configuration> <releaseProfiles>install</releaseProfiles> <tagNameFormat>v@{project.version}</tagNameFormat> </configuration> </plugin>
git push
(1) release.properties
を削除
(2) versionに-SNAPSHOT
をつける
<version>5.3.10-SNAPSHOT</version>
$ mvn release:prepare : [INFO] Checking dependencies and plugins for snapshots ... What is the release version for "hayashilib"? (haya4.tools:hayashilib) 0.0.3: :
0.0.3
0.0.3
What is SCM release tag or label for "AdjustTime"? (osm.surveyor:AdjustTime) v5.3.10: : What is the new development version for "AdjustTime"? (osm.surveyor:AdjustTime) 5.3.11-SNAPSHOT: :
:
compile,test,install
が実行される
ビルドに成功すると、github へのユーザー名とパスワードを何度か聞かれる
Username for 'https://github.com': yuuhayashi Password for 'https://yuuhayashi@github.com': ******** Username for 'https://github.com': yuuhayashi Password for 'https://yuuhayashi@github.com': ********
(1) 実行。 Javadocをスキップして実行する。
mvn release:perform -Dmaven.javadoc.skip : [INFO] Cleaning up after release... [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 03:42 min [INFO] Finished at: 2020-12-08T05:51:48+09:00 [INFO] ------------------------------------------------------------------------
(約5分以上かかる)
archivaにartifactが作成されていることを確認する
pom.xmlのバージョンが次の開発バージョンに自動的に変更される
<version>5.3.11-SNAPSHOT</version> <scm> <connection>scm:git:http://surveyor.mydns.jp/gitbucket/git/yuu/AdjustTime.git</connection> <url>http://surveyor.mydns.jp/gitbucket/yuu/AdjustTime/wiki</url> <developerConnection>scm:git:http://surveyor.mydns.jp/gitbucket/git/yuu/AdjustTime.git</developerConnection> <tag>v5.3.10</tag> </scm>
[INFO] Uploading to surveyor.haya4: http://surveyor.mydns.jp/archiva/repository/haya4/osm/surveyor/movie2jpg/Movie2jpg/2.0.0/Movie2jpg-2.0.0-jar-with-dependencies.jar [INFO] [INFO] ------------------------------------------------------------------------ [INFO] [INFO] BUILD FAILURE [INFO] [INFO] ------------------------------------------------------------------------ [INFO] [INFO] Total time: 33.228 s [INFO] [INFO] Finished at: 2021-03-28T13:24:05+09:00 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] [WARNING] The requested profile "install" could not be activated because it does not exist. [INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project Movie2jpg: Failed to deploy artifacts: Could not transfer artifact osm.surveyor.movie2jpg:Movie2jpg:jar:jar-with-dependencies:2.0.0 from/to surveyor.haya4 (http://surveyor.mydns.jp/archiva/repository/haya4/): Failed to transfer file: http://surveyor.mydns.jp/archiva/repository/haya4/osm/surveyor/movie2jpg/Movie2jpg/2.0.0/Movie2jpg-2.0.0-jar-with-dependencies.jar. Return code is: 413, ReasonPhrase: Request Entity Too Large. -> [Help 1]
$ scp ./Movie2jpg-2.0.0-jar-with-dependencies.jar pi@raspi2:~/ $ ssh pi@raspi2 $ cd /opt/archiva/repositories/repositories/haya4/osm/surveyor/movie2jpg/Movie2jpg/2.0.0 $ sudo mv ~/Movie2jpg-2.0.0-jar-with-dependencies.jar . $ sudo chown archiva:archiva *.jar