共有ライブラリを管理するために Sonatype の Nexus Repository Manager OSS を使用する ( その16 )( Nexus を 3.0.1-01 → 3.1.0-04 へバージョンアップする )
概要
- 今回の手順で確認できるのは以下の内容です。
- Download Nexus Repository OSS ( http://www.sonatype.com/download-oss-sonatype ) から nexus-3.1.0-04-win64.zip がダウンロード可能になっていましたので、Nexus を 3.0.1-01 → 3.1.0-04 へバージョンアップします。
- 3.1.0 の Release Notes は Nexus Repository Manager 3.1.0 Release Notes ( https://support.sonatype.com/hc/en-us/articles/231713648-Nexus-Repository-Manager-3-1-0-Release-Notes ) です。
- バージョンアップ及びインストールの手順は以下のドキュメントを参考にします。
- How to Upgrade Nexus Repository Manager 3.0.2 to 3.1.0
https://support.sonatype.com/hc/en-us/articles/231723267 - Documentation Nexus Repository Manager 3.1 - Chapter 2. Installation and Running
https://books.sonatype.com/nexus-book/reference3/install.html#service-windows
- How to Upgrade Nexus Repository Manager 3.0.2 to 3.1.0
参照したサイト・書籍
目次
- nexus-3.1.0-04-win64.zip をダウンロードする
- nexus のサービスを停止する
- 3.0.1-01 をインストールした C:\nexus を別のディレクトリへコピーした後、アンインストールしてサービスを削除する
- nexus-3.0.1-01-win64.zip を解凍して C:\nexus の下に必要なディレクトリ・ファイルをコピーする
- nexus を起動する
- nexus を Windows のサービスに登録して起動する
- メモ書き
手順
nexus-3.1.0-04-win64.zip をダウンロードする
Download Nexus Repository OSS ( http://www.sonatype.com/download-oss-sonatype ) のページにアクセスします。
ページ内の「nexus-3.1.0-04-win64.zip」リンクをクリックして nexus-3.1.0-04-win64.zip をダウンロードします。exe 版がなくなっていますね。
nexus のサービスを停止する
管理ツールのサービスを開いてサービス一覧から「nexus」を選択した後、「サービスの停止」リンクをクリックしてサービスを停止します。
3.0.1-01 をインストールした C:\nexus を別のディレクトリへコピーした後、アンインストールしてサービスを削除する
作業用のディレクトリとして C:\tmp__work_nexus を作成します。
C:\nexus を C:\tmp__work_nexus の下へコピーします。
コントロールパネルから「プログラムと機能」を開き、「Sonatype Nexus 3.0.1-01」をアンインストールします。
管理ツールの「サービス」を開いて、nexus のサービスが削除されていることを確認します。
nexus-3.1.0-04-win64.zip を解凍して C:\nexus の下に必要なディレクトリ・ファイルをコピーする
ダウンロードした nexus-3.1.0-04-win64.zip を C:\tmp__work_nexus へコピーした後、解凍します。解凍すると以下のディレクトリが作成されます。
ちなみに退避した 3.0.1-01 のディレクトリ構成は以下のようになっていました。
C:\nexus の下に data フォルダが残っている場合には削除します。
C:\tmp__work_nexus\nexus-3.1.0-04-win64 の下の2つのフォルダ(nexus-3.1.0-04、sonatype-work)を C:\nexus の下にコピーします。
C:\tmp__work_nexus\nexus\data の下のフォルダ・ファイル一式を C:\nexus\sonatype-work\nexus3 の下へコピーします。
nexus を起動する
コマンドプロンプトから
nexus.exe /run
を実行して起動・インストールします。(.....しばらくログが出続けます.....)
起動後 http://localhost:8081/ にアクセスすると nexus の管理画面が表示されました。画面左上のバージョン番号も「OSS 3.1.0-04」と表示されています。
以前登録した ksbysample-library-simpleutils、ksbysample-library-depend-nospring のコンポーネントが登録されているか確認しましたが、問題なく登録されていました。
admin / admin123 でログインできるか確認しましたが、問題なくログインできました。
管理画面の左側のメニューも 3.0.1-01 の頃と大きくは変わっていないようです。
起動後の C:\nexus のディレクトリ構成は以下のようになっていました。C:\nexus\sonatype-work\nexus3\etc の下は起動前は空だったのですが、起動後に nexus.properties が作成されていました。
nexus.properties の中は以下の内容が記述されています。
# Jetty section # application-port=8081 # application-host=0.0.0.0 # nexus-args=${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-requestlog.xml # nexus-context-path=/ # Nexus section # nexus-edition=nexus-pro-edition # nexus-features=\ # nexus-pro-feature
JVMのオプションやデータディレクトリの指定等は C:\nexus\nexus-3.1.0-04\bin\nexus.vmoptions に設定されるようです。
-Xms1200M -Xmx1200M -XX:MaxDirectMemorySize=2G -XX:+HeapDumpOnOutOfMemoryError -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:+LogVMOutput -XX:LogFile=../sonatype-work/nexus3/log/jvm.log -Djava.net.preferIPv4Stack=true -Dkaraf.home=. -Dkaraf.base=. -Dkaraf.etc=etc/karaf -Djava.util.logging.config.file=etc/karaf/java.util.logging.properties -Dkaraf.data=../sonatype-work/nexus3 -Djava.io.tmpdir=../sonatype-work/nexus3/tmp -Dkaraf.startLocalConsole=false
nexus.exe を起動したコマンドプロンプトで Ctrl+C を押して停止します。
nexus を Windows のサービスに登録して起動する
コマンドプロンプトを「管理者として実行...」で起動した後、
nexus.exe /install nexus
を実行しサービスを登録します。サービスの画面を開いて nexus が登録されていることを確認した後、「サービスの開始」リンクをクリックして起動します。
http://localhost:8081/ にアクセスして管理画面が表示されることを確認します。
メモ書き
- nexus-3.1.0-04 の Windows のサービス登録には Apache Karaf ( http://karaf.apache.org/ ) が使用されているようです。Linux のサービス登録にも使用できるようです。初めて聞きました。
ソースコード
履歴
2016/11/29
初版発行。