07スプリングガイドに変更
6533 ワード
1.スプリングガイド用STSをインストールして実行し(version 4.2.0)、JDKバージョンを次のように11以上にアップグレードする
->ただしエラーが発生したため、JDKバージョンは8バージョンです.
2.File>New>Spring Starter Project、以下のように設定
以下を選択します.
先ほど1で述べたようにJDKバージョンは8バージョンです
3. pom.xmlにjsonとmybatisライブラリ依存性を追加する
jsonだけを置く
4. src/main/resources/application.propertiesについて次の設定を行います.
以前のプロジェクトのmybatisフォルダをsrc/main/resources/にコピー
既存のSpringレガシーアイテム
ばね起動項目
仕入先フォルダがありません.
6. myBatisConfig.xmlをに変更
8.実行後、同じサービスが提供されているかどうかを確認します.
スプリングガイドで自動的に再ロードされる設定:
pom.xmに次の内容を追加します:l
->ただしエラーが発生したため、JDKバージョンは8バージョンです.
2.File>New>Spring Starter Project、以下のように設定


以下を選択します.
先ほど1で述べたようにJDKバージョンは8バージョンです

3. pom.xmlにjsonとmybatisライブラリ依存性を追加する

<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
mybatisはすでに上に設定されています.jsonだけを置く
4. src/main/resources/application.propertiesについて次の設定を行います.

server.port=8090
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/cafe
spring.datasource.username=ssafy
spring.datasource.password=12345
mybatis.config-location=classpath:mybatis/model/myBatisConfig.xml
mybatis.type-aliases-package=com.ssafy.web.vo
5.src/main/resources/staticで、以前のプロジェクトのhtml、css、js、img、仕入先フォルダ、indexを使用します.htmlのコピー以前のプロジェクトのmybatisフォルダをsrc/main/resources/にコピー
既存のSpringレガシーアイテム


ばね起動項目

仕入先フォルダがありません.
6. myBatisConfig.xmlをに変更

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<mappers>
<mapper resource="mybatis/mappers/member.xml"/>
<mapper resource="mybatis/mappers/order.xml"/>
</mappers>
</configuration>
**7. 以前のプロジェクトのjavaソースコードをsrc/main/javaの下にコピー
8.実行後、同じサービスが提供されているかどうかを確認します.
スプリングガイドで自動的に再ロードされる設定:
pom.xmに次の内容を追加します:l

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
Reference
この問題について(07スプリングガイドに変更), 我々は、より多くの情報をここで見つけました https://velog.io/@fe26min/07-스프링부트로-변경하기テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol