8.2. 必須プラグイン
8.2.1. プラグイン一覧
| プラグイン | 用途 |
|---|---|
spring-boot-maven-plugin | Spring Boot 実行可能JARパッケージング |
maven-compiler-plugin | Javaコンパイラ設定 |
spotless-maven-plugin | Google Java Format フォーマット検証 |
flyway-maven-plugin | データベースマイグレーション |
jooq-codegen-maven | jOOQ タイプセーフコード生成 |
maven-surefire-plugin | 単体テスト実行 |
jacoco-maven-plugin | テストカバレッジ測定 |
参考
flyway-maven-plugin と jooq-codegen-maven の詳細設定については、それぞれ Flywayマイグレーション と jOOQ使用標準 のドキュメントを参照してください。
8.2.2. maven-compiler-plugin
xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>21</source>
<target>21</target>
<parameters>true</parameters>
<compilerArgs>
<arg>-Xlint:all</arg>
</compilerArgs>
</configuration>
</plugin><parameters>true</parameters>: メソッドパラメータ名をバイトコードに保持します。Springの@RequestParam、@PathVariableなどにおける名前マッピングに必要です。-Xlint:all: すべてのコンパイル警告を有効化します。
8.2.3. spotless-maven-plugin
Google Java Formatをビルド時に自動検証します。詳細設定については Javaコードコンベンション のドキュメントを参照してください。
8.2.4. jacoco-maven-plugin
xml
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.80</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>