5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

VSCode拡張機能Community Server Connectorsのデプロイ時の挙動について調べてみた

Last updated at Posted at 2022-09-09

はじめに

前回の記事の続きです。

今回は、Community Server Connectorsの詳細のディレクトリ構成や、デプロイ時の操作による挙動を確認してみました。

環境

  • VSCodeインストール済(Windows版)
  • 拡張機能Community Server Connectorsv0.25.6がインストール済
  • 拡張機能Remote Server Protocol UIv0.23.13がインストール済
  • 今回は検証としてTomcat8.5を立てます。

インストール時

拡張機能Community Server Connectorsが起動した段階では、以下のディレクトリが存在しています。

  • C:\Users\ユーザー名\配下に隠しフォルダ.rspが生成
  • .rspフォルダ内にはredhat-community-server-connectorフォルダが生成
    image.png

サーバーの作成

次に、Create New ServerよりApache Tomcat 8.5.50を選択しダウンロード

image.png
image.png

この段階では、ディレクトリ内が以下状態となっていました。

  • C:\Users\ユーザー名\.rsp\redhat-community-server-connector\runtimes\downloadsディレクトリが生成
    • apache-tomcat-8.5.50.zipがダウンロード
  • C:\Users\ユーザー名\.rsp\redhat-community-server-connector\runtimes\installationsディレクトリが生成
    • フォルダtomcat-8.5.50が展開
  • C:\Users\akita\.rsp\redhat-community-server-connector\serversディレクトリが生成
    • apache-tomcat-8.5.50というファイルが生成
apache-tomcat-8.5.50
{
  "args.override.boolean": "false",
  "args.program.override.string": "start",
  "args.vm.override.string": "-Djava.util.logging.config.file=/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dcatalina.base= -Dcatalina.home=C:\\Users\\ユーザー名\\.rsp\\redhat-community-server-connector\\runtimes\\installations\\tomcat-8.5.50\\apache-tomcat-8.5.50 -Djava.io.tmpdir=/temp",
  "id": "apache-tomcat-8.5.50",
  "id-set": "true",
  "org.jboss.tools.rsp.server.typeId": "org.jboss.ide.eclipse.as.server.tomcat.85",
  "server.base.dir": "C:\\Users\\ユーザー名\\.rsp\\redhat-community-server-connector\\runtimes\\installations\\tomcat-8.5.50\\apache-tomcat-8.5.50",
  "server.deploy.dir": "${server.base.dir}/webapps/",
  "server.home.dir": "C:\\Users\\ユーザー名\\.rsp\\redhat-community-server-connector\\runtimes\\installations\\tomcat-8.5.50\\apache-tomcat-8.5.50",
  "server.http.port": "8080"
}

GUIからEdit Serverを選択すると、C:\Users\ユーザ名\AppData\Local\Temp内にあるtmpServerConnector-apache-tomcat-8.5.50~~~.jsonといったファイルが開かれますが、上記ファイルapache-tomcat-8.5.50とリンクしているようです。
image.png

※こちらについてはC:\Users\ユーザー名\.rsp\redhat-community-server-connector\runtimes配下のURLTransportCache.cacheIndex.properties内に記載がありました。

Add Deployment(File)

ここからは、war展開時のディレクトリ構造や挙動を見てみます。

まずはAdd Deploymentを選択
image.png
FileExplodedを選べますが、ここではFileを選択(sample.war)
image.png
オプションのパラメータはNoを選択
image.png
先程のapache-tomcat-8.5.50ファイル内のserver.deploy.dirとして指定のあるwebapps配下にsample.warsampleが展開されます。
image.png
localhost:8080/sample/でsampleを表示
image.png

Add Deployment(Exploded)

Add Deploymentとして、Explodedを選択した場合の挙動を確認します。
※先ほど展開されたsampleフォルダを使います。
image.png
すると、sampleフォルダのみwebapps配下に展開されます。
image.png

ちなみに、元のファイルを変更した際、自動的にwebapps内のファイルも更新されるかが気になったので、元の指定ファイルindex.htmlを編集してみました。

すると、publishが自動で走りファイル間の同期が行われます。
image.png
image.png

localhost:8080/sample/で見てみると、webapps内にファイルの変更が反映されていることが分かります。

それ以外に調べた事

  • 同一バージョンの複数のtomcatを登録する事も可能のようです。
    image.png

まとめ

  • 気軽にサーバーを構築・破棄出来る点は非常だと感じました。
  • また、ファイル変更時に自動的にpublishが走る点も便利そうです。
5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?