###前提・実現したいこと
SpringBootプログラミング入門という本を参考に、
SpringToolSuite(sts-bundle 3.7.1)でテンプレートエンジンthymeleafを追加して
Controllerを実装しようとしましたが下記のコンパイル?エラーが発生しました。
強制実行してみても作成したテンプレートが反映されませんでした。
ライブラリ等はpomで管理しているものと思っていたのですが、
外部Jarが必要ということでしょうか。。。
よろしくお願いいたします。
###発生している問題・エラーメッセージ
エラーメッセージ Archive for required library: '/Users/user/.m2/repository/org/codehaus/groovy/groovy/2.4.12/groovy-2.4.12.jar' in project 'MyBootApp' cannot be read or is not a valid ZIP file MyBootApp Build path Build Path Problem The project cannot be built until build path errors are resolved MyBootApp Unknown Java Problem
###該当のソースコード
HeloController
import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class HeloController { @RequestMapping("/") public String index(){ return "index"; } }
index.html
<!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Insert title here</title> <style> h1{font-size:18pt;font-weight:blod;color:gray;} body{font-size:13pt;color:gray;margin:5px 25px;} </style> </head> <body> <h1>Hello page</h1> <p class="msg">this is Thymeleaf</p> </body> </html>
◆pom.xmlに下記を追加
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>
###試したこと
エラーにあるgroovy-2.4.12.jarを外部jarとしてプロジェクトに追加してみましたが
同じエラーで変化がありませんでした。
###補足情報(言語/FW/ツール等のバージョンなど)
os:MacOS Sierra
jdk:1.8.0_144
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/09/12 16:36