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