0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Springでibatisがインポートできなかった時の対処方法

Posted at

経緯

SpringBootの勉強でAPIサーバを作成しようと以下の記事を見ながら進めていたところ、Mapperインターフェースを作成した際に org.apache.ibatis.annotations.Param のインポートが必要になった。しかし記載の通りに進めても認識されなかったため、ライブラリの追加方法を調べた。

Springのプロジェクト自体はSpring initializrで以下のライブラリを加えて作成した。

  • Spring Web
  • MyBatis Framework
  • PostgreSQL Driver
  • Lombok

環境

  • OS: MacOS
  • IDE: IntelliJ

現象

 import org.apache.ibatis.annotations.Param;

上記のような形でインポートをするも認識されなかった。

対処方法

pom.xmlのdependencyに書こうにも、どう書いていいのかの情報を発見できなかったため、色々IntelliJをいじり回した。
その結果、 + ; でプロジェクト設定を開き、その中のモジュール依存関係+をクリックすることでライブラリを追加できることを発見した。さらにライブラリ...Mavenから... を選択することでライブラリを検索することができ、org.apache.ibatisで検索してapache.ibatis.coreをインポートすることができた。

おわり

ibatisってMyBatis Frameworkに入ってるわけじゃないんですかね...?

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?