Maven compiler --release option 이란?

ASHAPPYASIKNOW·2022년 7월 19일
0

MAVEN/Gradle

목록 보기
1/2
post-thumbnail

--release option

JDK9 이상의 버전을 사용하는 경우 --release 옵션을 사용할 수 있다.

용도: 현재 사용 중인 버전과 다른 버전으로 컴파일할 때 이 옵션을 사용할 수 있다.

-source, -target 옵션과는 다르게 컴파일할 때 해당 버전을 사용하는 것을 보장해 준다.


<project>
  [...]
  <build>
    [...]
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.10.1</version>
        <configuration>
          <release>8</release>
        </configuration>
      </plugin>
    </plugins>
    [...]
  </build>
  [...]
</project>

REFERENCES

Setting the --release of the Java Compiler

profile
36.9 It's good time to start something new

0개의 댓글