Skip to content

8.2. 必須プラグイン

8.2.1. プラグイン一覧

プラグイン用途
spring-boot-maven-pluginSpring Boot 実行可能JARパッケージング
maven-compiler-pluginJavaコンパイラ設定
spotless-maven-pluginGoogle Java Format フォーマット検証
flyway-maven-pluginデータベースマイグレーション
jooq-codegen-mavenjOOQ タイプセーフコード生成
maven-surefire-plugin単体テスト実行
jacoco-maven-pluginテストカバレッジ測定

参考

flyway-maven-pluginjooq-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>

TIENIPIA QUALIFIED STANDARD