Migration Guide 5.7.3_ja - terasolunaorg/terasoluna-gfw GitHub Wiki

5.7.2から5.7.3への移行ガイド

目次
Note

5.7.2.RELEASEから5.7.3.RELEASEの移行手順として説明します。

1. 5.7.3での主な変更点

5.7.3での主な変更点は以下の通りです。

  • 主要なライブラリのバージョンを更新

  • ブランクプロジェクトの変更

1.1. 主要なライブラリのバージョンを更新

  • Spring Boot Dependencies 2.7.18へ更新

    • Spring Framework 5.3.31へ更新

    • Spring Security 5.7.11へ更新

    • Spring Dateを2.7.18へ更新

  • MyBatis 3.5.15へ更新

1.2. 共通ライブラリの変更

  • 共通ライブラリのライブラリ及びMavenプラグインのバージョンを変更

    • [#1266] Apply Spring Boot 2.7.18

    • [#1278] Update the library version

    • [#1285] Delete commons-fileupload

1.3. ブランクプロジェクトの変更

  • ブランクプロジェクトのライブラリ及びMavenプラグインのバージョンを変更

2. 5.7.2から5.7.3への移行手順

移行手順は、以下の通りです。

Note

凡例
必須 : 手順の適用は必須
条件付き必須 : 手順の適用は条件付きで必須
推奨 : 手順の適用を推奨
任意 : 必要に応じて手順の適用を実施
- : 手順の適用は必要なし

ステップ 手順 MavenMultiple Projects MavenSingle Project

1.

依存ライブラリを更新

必須

必須

2.

aop:aspectj-autoproxyの追加

任意

任意

3.

TomcatのRFC9239準拠

条件付き必須

条件付き必須

4.

Commons File Uploadの削除に伴う対応

条件付き必須

条件付き必須

5.

webdrivermanagerの追加

任意

任意

2.1. [Step 1] 依存ライブラリを更新

TERASOLUNA Server Framework for Java (5.x)の共通ライブラリと依存ライブラリを更新してください。
以下に、この手順により更新される代表的な依存ライブラリを示します。

ライブラリ名 更新前バージョン 更新後バージョン 備考

TERASOLUNA Server Framework for Java (5.x) Common Library

5.7.2.RELEASE

5.7.3.RELEASE

Spring Framework

5.3.24

5.3.31

Spring Data

2.7.6

2.7.18

Spring Security

5.7.6

5.7.11

MyBatis3

3.5.11

3.5.15

MyBatis3 Spring

2.1.0

2.1.2

Hibernate ORM

5.6.14.Final

5.6.15.Final

Logback

1.2.11

1.3.14

SLF4J

1.7.36

2.0.12

Jackson

2.13.4.2

2.13.5

Joda Time

2.12.2

2.12.5

Commons Fileupload

1.4

削除

OpenPDF

1.3.20

1.3.35

Apache POI

5.2.3

5.2.5

Google Guava

31.1-jre

33.0.0-jre

Apache Commons IO

2.11.0

2.15.1

Lombok

1.18.24

1.18.30

[手順が必要なケース]

この手順の適用は必須です。

2.1.1. [Step 1-1] オンライン環境でバージョン更新を実施する場合

この更新手順は、Mavenをオンライン環境で使用しているプロジェクト向けです。

  • Maven Multiple Projectsを利用している場合
    この更新手順は、 multi blank を使用して作成したマルチプロジェクト向けです。

    親プロジェクトのPOMファイルのversion5.7.3.RELEASEに修正してください。

    • ($YOUR_MULTIPLE_PROJECT_ROOT/pom.xml)

      <!-- omitted -->
      <parent>
          <groupId>org.terasoluna.gfw</groupId>
          <artifactId>terasoluna-gfw-parent</artifactId>
          <version>5.7.3.RELEASE</version>                    <!-- ### 修正箇所 ### -->
      </parent>
      <!-- omitted -->
  • Maven Single Projectを利用している場合
    この更新手順は、 single blank を使用して作成したシングルプロジェクト向けです。

    プロジェクトのPOMファイルのversion5.7.3.RELEASEに修正してください。

    • ($YOUR_SINGLE_PROJECT/pom.xml)

      <!-- omitted -->
      <parent>
          <groupId>org.terasoluna.gfw</groupId>
          <artifactId>terasoluna-gfw-parent</artifactId>
          <version>5.7.3.RELEASE</version>                    <!-- ### 修正箇所 ### -->
      </parent>
      <!-- omitted -->

2.1.2. [Step 1-2] オフライン環境でバージョン更新を実施する場合

この更新手順は、依存ライブラリをインターネットにつながる環境でダウンロードし、ダウンロードした依存ライブラリをオフライン環境のプロジェクトに展開することで、Mavenをオフライン環境で使用しているプロジェクト向けです。

以下に記載する手順を実施してください。

  1. オンライン環境

    1. ブランクプロジェクトを作成
      ガイドラインの記述を参考に、archetype:generateを実行し、5.7.3.RELEASEのブランクプロジェクトを作成してください。

    2. 依存関係の追加
      現行アプリのpom.xmlを確認し、アプリ独自で設定しているdependencyをブランクプロジェクトのpom.xmlに追加してください。
      アプリ独自で設定しているdependencyが不明な場合は、現行アプリで採用しているバージョンのブランクプロジェクトも作成して比較してください。

    3. ローカルリポジトリへのダウンロード
      以下のコマンドを実行し、依存ライブラリおよびMavenビルドに必要となるライブラリやプラグイン等をローカルリポジトリ(repositoryディレクトリ)へダウンロードしてください。

      mvn -P warpack clean install -Dmaven.repo.local=repository
      mvn dependency:go-offline -Dmaven.repo.local=repository
  2. オンライン環境⇒オフライン環境

    1. オフライン環境へのコピー
      repositoryをオフライン環境の「ユーザのホームディレクトリ/.m2」へコピーしてください。

  3. オフライン環境

    1. POMの修正
      オフライン環境のプロジェクトにて、[Step 1-1]に記載されている内容と同様に、pom.xmlのバージョン表記を修正してください。

    2. ビルドの実行

      1. envモジュールのjarファイルをwarファイルに含めない場合
        以下のコマンドを実行してください。

        mvn -P warpack clean install

        xxx-env配下に移動し以下のコマンドを実行してください。

        mvn -P test-server clean package
      2. envモジュールのjarファイルをwarファイルに含める場合
        以下のコマンドを実行してください。

        mvn -P warpack-with-env,test-server clean package

2.2. [Step 2] aop:aspectj-autoproxyの追加

5.9.0.RELEASEの対応で、XMLConfigベースのブランクプロジェクトにaop:aspectj-autoproxyを追加しました。
XMLConfigベースのブランクプロジェクトではアノテーションベースのAOPは必須ではありませんが、ConfigrationにJavaConfigを追加する対応の一環で、アノテーションベースのAOPを有効にするためweb層にEnableAspectJAutoProxyを追加しています。JavaConfigとXMLConfigの設定を統一する目的で、XMLConfigベースのブランクプロジェクトにもaop:aspectj-autoproxyを追加しました。

[手順が必要なケース]

この手順の適用は任意です。

[修正方法]

applicationContext.xmlおよびspring-mvc.xmlaop:aspectj-autoproxyを追加します。

  • ($YOUR_PROJECT/src/main/resources/META-INF/spring/applicationContext.xml)

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:aop="http://www.springframework.org/schema/aop" <!-- ### 追加箇所 ### -->
        xsi:schemaLocation="
            http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd
            http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop.xsd <!-- ### 追加箇所 ### -->
        ">
    
        <!-- omitted -->
    
        <aop:aspectj-autoproxy /> <!-- ### 追加箇所 ### -->
    
        <!-- omitted -->
    
    </beans>
  • ($YOUR_PROJECT/src/main/resources/META-INF/spring/spring-mvc.xml)

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:mvc="http://www.springframework.org/schema/mvc"
        xmlns:util="http://www.springframework.org/schema/util"
        xmlns:aop="http://www.springframework.org/schema/aop"
        xsi:schemaLocation="http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd
            http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd
            http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd
            http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop.xsd
        ">
    
        <!-- omitted -->
    
        <aop:aspectj-autoproxy /> <!-- ### 追加箇所 ### -->
    
        <!-- omitted -->
    
    </beans>

2.3. [Step 3] TomcatのRFC9239準拠

Tomcat 9.0.74 から RFC9239 に準拠するよう変更されました。この影響により、text/ecmascriptapplication/javascriptapplication/ecmascriptが非公開となりtext/javascriptが返却されるようになります。

[手順が必要なケース]

この手順の適用は条件付き必須です。
以下のケースに当てはまる場合、修正を行ってください。

  • リクエストを受け取るアプリケーションサーバにTomcat 9.0.74以上のバージョンを使用している

  • Content-Typeヘッダにtext/ecmascriptapplication/javascriptapplication/ecmascriptのいずれかを指定している

[修正方法]

Content-Typeヘッダに指定する値をtext/javascriptに変更する。

2.4. [Step 4] Commons FileUploadの削除に伴う対応

Servletのファイルアップロード機能で問題が発生する場合の回避策としてCommons FileUploadを使用したファイルアップロードの方法を案内していましたが、現在対象としている動作検証環境ではServletのファイルアップロード機能における問題は発生しないため、ガイドラインからCommons FileUploadに関する記載を削除しました。 これに伴い、terasoluna-gfw-parentからもCommons FileUploadの依存性を削除しました。

[手順が必要なケース]

この手順の適用は条件付き必須です。
以下のケースに当てはまる場合、修正を行ってください。

  • Commons FileUploadを明示的に使用している場合

[修正方法]

Commons FileUpload の設定にバージョンを追加します。
Commons FileUpload のバージョンはアプリケーションにとって適切なものになるように設定してください。

  • xxx-web/pom.xml

<dependency>
    <groupId>commons-fileupload</groupId>
    <artifactId>commons-fileupload</artifactId>
    <version>xxxx</version> <!-- ### 追加箇所 ### -->
</dependency>

2.5. [Step 5] webdrivermanagerの追加

blankプロジェクトのPOMにwebdrivermanagerの依存関係を追加しました。

[手順が必要なケース]

この手順の適用は任意です。
seleniumを使用した試験を実施しない場合は適用する必要はありません。

[修正方法]

  • Maven Multiple Projectsを利用している場合
    この更新手順は、 multi blank を使用して作成したマルチプロジェクト向けです。

    親プロジェクトのPOMファイルにwebdrivermanagerを追加してください。

    • ($YOUR_MULTIPLE_PROJECT_ROOT/pom.xml)

          <dependencyManagement>
              <dependencies>
                  <!-- omitted -->
                  <!-- == Begin Unit Test == -->
                  <dependency>
                      <groupId>junit</groupId>
                      <artifactId>junit</artifactId>
                      <scope>test</scope>
                  </dependency>
                  <!-- ### 追加箇所 開始 ### -->
                  <dependency>
                      <groupId>io.github.bonigarcia</groupId>
                      <artifactId>webdrivermanager</artifactId>
                      <version>${webdrivermanager.version}</version>
                      <scope>test</scope>
                  </dependency>
                  <!-- ### 追加箇所 終了 ### -->
                  <dependency>
                      <groupId>org.mockito</groupId>
                      <artifactId>mockito-core</artifactId>
                      <scope>test</scope>
                  </dependency>
                  <!-- omitted -->
              </dependencies>
          </dependencyManagement>
      
          <properties>
              <!-- omitted -->
              <webdrivermanager.version>5.6.3</webdrivermanager.version> <!-- ### 追加箇所 ### -->
              <!-- omitted -->
          </properties>
  • Maven Single Projectを利用している場合
    この更新手順は、 single blank を使用して作成したシングルプロジェクト向けです。

    プロジェクトのPOMファイルにwebdrivermanagerを追加してください。

    • ($YOUR_SINGLE_PROJECT/pom.xml)

          <dependencies>
              <!-- omitted -->
              <!-- == Begin Unit Test == -->
              <dependency>
                  <groupId>junit</groupId>
                  <artifactId>junit</artifactId>
                  <scope>test</scope>
              </dependency>
              <!-- ### 追加箇所 開始 ### -->
              <dependency>
                  <groupId>io.github.bonigarcia</groupId>
                  <artifactId>webdrivermanager</artifactId>
                  <version>${webdrivermanager.version}</version>
                  <scope>test</scope>
              </dependency>
              <!-- ### 追加箇所 終了 ### -->
              <dependency>
                  <groupId>org.mockito</groupId>
                  <artifactId>mockito-core</artifactId>
                  <scope>test</scope>
              </dependency>
              <!-- omitted -->
          </dependencies>
      
          <properties>
              <!-- omitted -->
              <webdrivermanager.version>5.6.3</webdrivermanager.version> <!-- ### 追加箇所 ### -->
              <!-- omitted -->
          </properties>
⚠️ **GitHub.com Fallback** ⚠️