gradleでプラグインを組み込む方法を記載します。
以下では、Bootstrap、Bootstrap-multiselectを組み込みます。
同時にHTML上でのバージョンの指定をwebjarsに依存させるため、webjars-locatorを利用します。
プラグイン情報は以下から検索することができます。
implementation 'org.webjars:webjars-locator:0.42'
implementation 'org.webjars.bower:bootstrap:4.5.3'
implementation 'org.webjars.bower:bootstrap-multiselect:1.1.1'
Thymeleafでは、以下のようにth:srcに指定します。
ソースの場所は、Eclipseのプロジェクトの「パッケージ・エクスプローラー」上でも確認することができます。
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" lang="ja">
<body>
<th:block th:fragment="comscripts">
<!-- Bootstrap -->
<script th:src="@{/webjars/bootstrap/dist/js/bootstrap.bundle.min.js}"></script>
<script th:src="@{/webjars/bootstrap-multiselect/dist/js/bootstrap-multiselect.min.js}"></script>