Migration Guide 5.7.3_ja - terasolunaorg/terasoluna-gfw GitHub Wiki
Note
|
5.7.2.RELEASEから5.7.3.RELEASEの移行手順として説明します。 |
5.7.3での主な変更点は以下の通りです。
-
主要なライブラリのバージョンを更新
-
ブランクプロジェクトの変更
-
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へ更新
-
ブランクプロジェクトのライブラリ及びMavenプラグインのバージョンを変更
-
[single#596] [multi#653] Update the library version
-
移行手順は、以下の通りです。
Note
|
凡例 |
ステップ | 手順 | MavenMultiple Projects | MavenSingle Project |
---|---|---|---|
1. |
必須 |
必須 |
|
2. |
任意 |
任意 |
|
3. |
条件付き必須 |
条件付き必須 |
|
4. |
条件付き必須 |
条件付き必須 |
|
5. |
任意 |
任意 |
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 |
[手順が必要なケース]
この手順の適用は必須です。
この更新手順は、Mavenをオンライン環境で使用しているプロジェクト向けです。
-
Maven Multiple Projectsを利用している場合
この更新手順は、 multi blank を使用して作成したマルチプロジェクト向けです。親プロジェクトのPOMファイルの
version
を5.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ファイルの
version
を5.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 -->
-
この更新手順は、依存ライブラリをインターネットにつながる環境でダウンロードし、ダウンロードした依存ライブラリをオフライン環境のプロジェクトに展開することで、Mavenをオフライン環境で使用しているプロジェクト向けです。
以下に記載する手順を実施してください。
-
オンライン環境
-
ブランクプロジェクトを作成
ガイドラインの記述を参考に、archetype:generate
を実行し、5.7.3.RELEASEのブランクプロジェクトを作成してください。 -
依存関係の追加
現行アプリのpom.xml
を確認し、アプリ独自で設定しているdependencyをブランクプロジェクトのpom.xml
に追加してください。
アプリ独自で設定しているdependencyが不明な場合は、現行アプリで採用しているバージョンのブランクプロジェクトも作成して比較してください。 -
ローカルリポジトリへのダウンロード
以下のコマンドを実行し、依存ライブラリおよびMavenビルドに必要となるライブラリやプラグイン等をローカルリポジトリ(repositoryディレクトリ)へダウンロードしてください。mvn -P warpack clean install -Dmaven.repo.local=repository mvn dependency:go-offline -Dmaven.repo.local=repository
-
-
オンライン環境⇒オフライン環境
-
オフライン環境へのコピー
repositoryをオフライン環境の「ユーザのホームディレクトリ/.m2」へコピーしてください。
-
-
オフライン環境
-
POMの修正
オフライン環境のプロジェクトにて、[Step 1-1]に記載されている内容と同様に、pom.xml
のバージョン表記を修正してください。 -
ビルドの実行
-
envモジュールのjarファイルをwarファイルに含めない場合
以下のコマンドを実行してください。mvn -P warpack clean install
xxx-env配下に移動し以下のコマンドを実行してください。
mvn -P test-server clean package
-
envモジュールのjarファイルをwarファイルに含める場合
以下のコマンドを実行してください。mvn -P warpack-with-env,test-server clean package
-
-
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.xml
にaop: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>
Tomcat 9.0.74 から RFC9239 に準拠するよう変更されました。この影響により、text/ecmascript
、application/javascript
、application/ecmascript
が非公開となりtext/javascript
が返却されるようになります。
[手順が必要なケース]
この手順の適用は条件付き必須です。
以下のケースに当てはまる場合、修正を行ってください。
-
リクエストを受け取るアプリケーションサーバにTomcat 9.0.74以上のバージョンを使用している
-
Content-Typeヘッダに
text/ecmascript
、application/javascript
、application/ecmascript
のいずれかを指定している
[修正方法]
Content-Typeヘッダに指定する値をtext/javascript
に変更する。
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>
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>
-